Can someone show me how to use COM dll in C++? Here is my code so far:
I keep getting an "IComObject is an undeclared identifier." I used OleView and it shows that IComObject is an interface of that COM object. Any ideas?Code:#import "C:\\ComObject.dll" #include "stdafx.h" #include <objbase.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { CLSID Clsid; HRESULT a = ::CoInitialize(NULL); HRESULT b = ::CLSIDFromProgID(L"ComObject.ComMethod.1", &Clsid); IComObject * p; HRESULT c = ::CoCreateInstance(Clsid, NULL, CLSCTX_ALL, IID_IUnknown, (LPVOID*)&p); return 0; }


Reply With Quote