Reputation: 439
I am using mingw as a compiler, and i'm trying to get the wmi to work somehow, but the code depends on the
wbemidl.h
Wbemuuid.lib
how can i avoid using this librariy? For example
hr = CoCreateInstance(&CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, &IID_IWbemLocator, (LPVOID *) &locator);
How can i get CLSID_WbemLocator and IID_IWbemLocator myself? Also i need to somehow define myself the pointers to the COM interface.
IWbemLocator *locator = NULL;
IWbemServices *services = NULL;
IEnumWbemClassObject *results = NULL;
Anyone can help me?
Upvotes: 0
Views: 1335
Reputation: 21
I got CLSID_WbemLocator from the registry finding it under WBEMComLocator. Since my app is written in C I initialized the GUID structure so:
CLSID CLSID_WbemLocator = {0x4590F811, 0x1D3A, 0x11D0, {0x89, 0x1F, 0, 0xAA, 0, 0x4B, 0x2E, 0x24}};
With this solved I could run the example given under How to obtain data from WMI using a C Application? I think you have to use the libraries you mentioned. Why not? MinGW provides those libraries.
Upvotes: 2