What is the C ++ equivalent for GetObject in JavaScript and VBScript?
What is the C ++ equivalent for GetObject
in JavaScript and VBScript ?
The closest match I found to my question is:
http://codewiz51.blogspot.com/2008/06/vb-script-getobject-c-api-cogetobject.html
However, the sample is using an unused interface and requests to IUnknown
return null. Does anyone have an example that works?
source to share
I figured out the question. The object I wanted to get was
winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv
I mistook \\ for the descent. In C ++, the correct query is:
::CoGetObject(L"winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\default:StdRegProv", NULL, IID_IUnknown, (void**)&pUnk);
Thank:)
source to share