tags:

views:

693

answers:

1

Hi, I get the following error while trying to use hres = CoInitializeEx(0, COINIT_MULTITHREADED);

error C2065: 'CoInitializeEx' : undeclared identifier

I have already included:

#define _WIN32_DCOM
#include <iostream>
using namespace std;
#include <comdef.h>
#include <Wbemidl.h>

in my cpp file.

Kindly help.

Thanks, Neha

+3  A: 

Try placing the following line at the beginning of your precompiled header(stdafx.h).

#define _WIN32_WINNT 0x0400
arul