tags:

views:

116

answers:

1

Hi All,

I am using WMI to get SMBIOS data and for that I am using following code to initialize the IWbemLocator interface through a call to CoCreateInstance.

CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWebLocator, (LPVOID *) &pLoc);

But it always returns FAILURE. I think its due to some environment issue but wanted to know exact reason.

Thanks in advance,

Rahul

A: 

IID_IWebLocator? What's that? What is the HRESULT you get? Sample code is here, also note the CoInitializeSecurity() call.

Hans Passant
I got following error for CoCreateInstanceError- A specified class is not registered in the registration database.Any idea?Thanks
Rahul
That's *very* bad, hints at a registry that's toast. You could try randomly running regsvr32 on the DLLs in c:\windows\system32\wbem.
Hans Passant
Re registration of dll worked. I was just wondering why all of sudden already registered dll stopped working? Thanks in advance.
Rahul
Well, you untoasted the registry. Please close your thread by marking it answered.
Hans Passant