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

Posted: 09-20-2006, 08:33 PM
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

Reply With Quote

Responses to "WindowsXP, Visual Studio 2005, VC++ and WMI Calls"

SSN
Guest
Posts: n/a
 
Re: WindowsXP, Visual Studio 2005, VC++ and WMI Calls
Posted: 09-29-2006, 07:59 AM

Select PercentProcessorTime from Win32_PerfRawData_PerfProc_Process
gives me the correct values..

jmonetti wrote:
> 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
Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Open with" fails with Visual Studio 2005 Nick Payne Windows Vista File Management 0 10-22-2006 11:52 AM
visual studio and asp Aleks Kleyn Windows Vista Security 3 08-14-2006 10:06 PM
Installing Visual Studio 2005 on Vista Carl Daniel [VC++ MVP] Windows Vista Install & Setup 5 05-07-2006 01:25 AM
5308-64: Visual Studio 2005 setup dies at prerequisite install Andre Da Costa [Extended64] Windows Vista Install & Setup 1 04-03-2006 08:35 PM
Visual Studio 2005 Josh Ross Windows Vista 7 04-01-2006 10:57 AM


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90