Re: Component not working in VB.
"Jigar Mehta" <jigar.programmer@gmail.com> wrote in message
news:1148811087.916666.210040@j55g2000cwa.googlegroups.com
I just found that in VC++, I was using smart pointer class object to
create COM server instance. like,
IclassTestATL4Ptr iPtr;
HRESULT hRes = E_FAIL;
hRes = iPtr.CreateInstance(__uuidof(IclassTestATL4));
And this was giving me error of Class not registered. But I just tried
changing the code and tried creating COM Server Instance using CLSID
like,
hRes = iPtr.CreateInstance(CLSID_classTestATL4);
And it worked, called the method too. So, why using __uuidof not
working properly ?
You use __uuidof on the interface, and get interface's IID.
CreateInstance wants a CLSID. It would likely work like this:
hRes = iPtr.CreateInstance(__uuidof(classTestATL4));
Note no leading 'I'
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925