Sorry, I didnt notice that lpclf is the variables that receives the pointer.
Why not check why it's "always 0" for you, instead of complaining that it is? If the CoGetClassObject call can't obtain the class factory, it's usually because the registry entries are missing, incorrect, or the referenced dll can't be loaded, but then it should have returned a failure, and CoCreateInstance should then bail out before getting to this point. You could also find out why it didn't, then?
Yes, found it. The problem isnt in the macro. :) We should add a check in the case no class factory is found, to avoid crashing. But I dont understand why CoGetClassObject returns ok and leaves lpclf set to NULL. Adding a TRACE after CoGetClassObject I get : trace:ole:CoCreateInstance sanity check: hres=80040154, lpclf=00000000 trace:ole:CoCreateInstance sanity check: hres=00000000, lpclf=41fb14e4 trace:ole:CoCreateInstance sanity check: hres=80040154, lpclf=00000000 trace:ole:CoCreateInstance sanity check: hres=00000000, lpclf=40289148 trace:ole:CoCreateInstance sanity check: hres=00000000, lpclf=4029b7f8 trace:ole:CoCreateInstance sanity check: hres=00000000, lpclf=4029b830 trace:ole:CoCreateInstance sanity check: hres=00000000, lpclf=4029b668 trace:ole:CoCreateInstance sanity check: hres=00000000, lpclf=00000000 <= shouldnt happen.
===== Sylvain Petreolle (spetreolle at users dot sourceforge dot net) ICQ #170597259 No more War !
"What if tomorrow the War could be over ?" Morpheus, in "Reloaded".
For the Law of Oil and Fire, Im an European that lives in France. For all my Brothers and friends, Im a human living on Earth.
___________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com