error C2065: 'CoSetProxyBlanket' : undeclared identifier 问题解决方法


PDA

Click to See Complete Forum and Search --> : Question about WMI


godspeed
April 5th, 2006, 11:53 AM
Hi,

Can WMI be used in Visual C++ 6.0?

Thanks in advance

kirants
April 5th, 2006, 12:05 PM
Sure.

godspeed
April 6th, 2006, 09:40 PM
I tried adding the WMI code that works in .NET but I'm getting errors saying that:

error C2065: 'CoInitializeEx' : undeclared identifier
error C2065: 'CoSetProxyBlanket' : undeclared identifier
error C2065: 'EOAC_NONE' : undeclared identifier

This same code works in .NET, it seems that the problem is a direct issue of
#include file being different in 6.0 and in .NET.

Does anyone know how to resolve this problem.

Any help would be appreciated

kirants
April 12th, 2006, 08:53 PM
You need to #define this in your header file to use CoInitializeEx:

#define _WIN32_DCOM

 

你可能感兴趣的:(WMI)