Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get Memory and CPU Usage from Code. 1

Status
Not open for further replies.

TheMillionDollarMan

Programmer
Jun 10, 2002
132
US

How can I obtain information about PC performance using C++?

eg. CPU and Page File usage.

Thanks

MSVC++ 6.0, Windows 2k.
 
You can use the Pdh...... functions.

Search MSDN for PdhOpenQuery and other functions in the same family.

/JOlesen
 
Thanks!

I found some examples to use from MSDN however they don't compile.


I created a Console app the supports MFC and copied the code from this URL into the cpp.
I always get a linking problem. I looked in the help bt I can't seem to get past this.

Linking Error when compiling:
WinPerform2.obj : error LNK2001: unresolved external symbol _PdhEnumObjectItemsA@36
Debug/WinPerform2.exe : fatal error LNK1120: 1 unresolved externals

Thanks
D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top