I am trying to initialize a COM interface in a win32 project (VC.net) with the following(ish) code:
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
//start COM
if (SUCCEEDED(hr))
{
hr = CoCreateInstance(CLSID_DOMDocument,
NULL,
CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument,
(void**)&pXMLDoc);
For some reason, I am getting
d:\Documents and Settings\Josh\My Documents\Visual Studio Projects\Fly! V2\SettingsFile.cpp(13): error C2065: ''CoInitializeEx'' : undeclared identifier
I am including , , in due course of the files, yet still, ''tis broken...
The program does work if i use CoInitialize(...) instead, and also in the original program i used to build the class with the ...Ex(...) version.
But my main program code refuses to find the function as per the error above...
Any suggestions would be great - as you can see I am struggling for answers, and am currently suffering a distinct lack of references for this problem...
Anyway, thanks!