how to execute non-static method on class instance?
- From: trencan <trencan@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 17 Jul 2008 06:04:02 -0700
Hello,
I have one question. If I want to execute static method in WMI, there is no
problem.
CComPtr<IWbemServices> pSvc = NULL;
// set pSvc through ConnectServer()
hres = pSvc->ExecMethod(_bstr_t(_T("BcdStore")), _bstr_t(_T("OpenStore")),
0, NULL, pInParamsObj, &pOutParamsObj, NULL);
This works since OpenStore is static method of BcdStore class.
But once I have BcdStore class instance (OpenStore method creates instance),
then I need to call its member method OpenObject. How to do this?
I get output param from static method OpenStore() - BcdStore object:
IWbemClassObject* pBcdObj;
But now how should I call OpenObject method on this BcdStore object?
hres = pSvc->ExecMethod(strObjectPath, _bstr_t(_T("OpenObject")), 0, NULL,
pInParamsObj, &pOutParamsObj, NULL);
How should I use pBcdObj to get strObjectPath used in previous line of code?
Or is there some other way how to call method on class instance?
Thanks very much.
Michal
.
- Prev by Date: PasswordRequired on Win32_Account always true
- Next by Date: ProcessorLoad
- Previous by thread: PasswordRequired on Win32_Account always true
- Next by thread: ProcessorLoad
- Index(es):