Is there any other way to query the CPU usage other than using RegQueryValueEx?This is creating lots of problems....
Printable View
Is there any other way to query the CPU usage other than using RegQueryValueEx?This is creating lots of problems....
What kind of problems?
You can also get CUP usage using PDH counters. MSDN describes how to use PDH.
Hope this helps.
Thanks
-- Kedar
Thanks..
but iam facing a new problem now,,,,iam not able to c "processor" object in my perfmon..is there anyway by using PDH..i can programatically do it....
The wmi interface provides access to all the performance counters.
A search on the microsoft web site will provide lots of doc as well as sample c++ code.
On win2k and XP the processor object might be disabled.
Enable it by modifying the registry:
HKEY_LOCAL_MACHIN\SYSTEM\CurrentControlSet\Services\PerfOS\Performance. Set "Disable Performance Counters" to 0.
Take a look at the following thread...