WindowsXP, Visual Studio 2005, VC++ and WMI Calls

  • Thread starter Thread starter jmonetti
  • Start date Start date
J

jmonetti

Hello list,

I'm just starting with WMI and like ask you a paar questions.

I've developed a little application in VC++, which tries to retrieve
some CPU information through WMI calls. Here some code maybe
you have seen...

...
bstr_t cadenaSql = "Select * from
Win32_PerfRawData_PerfProc_Process where";
...
VariantInit(&vtProp2);
hr = pclsObj2->Get(L"PercentProcessorTime", 1, &vtProp2, 0, 0);
wcout << vtProp2.ulVal << endl ;
VariantClear(&vtProp2);
....

The problem I have is that when show vtProp2.ulVal receive the same
number (percent processor time) for each process retrieved.
(Even when I chage the value type).

Any suggestion ?


Thanks in advanced.


Julio
 
Select PercentProcessorTime from Win32_PerfRawData_PerfProc_Process
gives me the correct values..
 
Back
Top