tags:

views:

27

answers:

0

Hi i have a vb.net generated Dll with Com interop enabled. in my Vc++ 6.0 project i have included the .tlb and tried to create object for the class but it is failing for me.

CoInitialize(NULL); //initialize COM library
HRESULT hresult;
CLSID clsid;
hresult=CLSIDFromProgID(__uuidof(SHandler), &clsid);    //retrieve CLSID of component
SHandler *t; 
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_SHandler),(LPVOID *) &t);
if(FAILED(hresult))
{
    AfxMessageBox("Creation Failed");
    return 0;
}