you should use CoCreateInstance with CLSID of object you're looking for. You get an interface pointer and work with it or query other interfaces. Pay attention on return codes.
CoInitialize(NULL);
IDispatch* pDisp;
IUnknown* pUnk;
CLSID clsid;
CLSIDFromProgID(cApp,&clsid);
CoCreateInstance(clsid,NULL,CLSCTX_SERVER,IID_IUnknown,(void FAR*FAR*)&pUnk);
pUnk->QueryInterface(IID_IDispatch,(void**)&pDisp);
..work here
pDisp->Release();
pUnk->Release();
CoUninitialize(); John Fill
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.