Need help with using COM dll in C++
Can someone show me how to use COM dll in C++? Here is my code so far:
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;
}
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?
Re: Need help with using COM dll in C++
You're in the wrong place, mate.
Go to a C++ forum.