I want to find CPU load on PPC, and I have found the following post finally.
http://www.tech-archive.net/Archive/Win ... /0504.html
I can't build it successly, and I don't know how to do.I really want to know how can measure CPU load on PDA, because My school homework project is the PDA CPU monitor. Please help me, thank you very much.
build will make some error, like this
===================================================
corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function WinMainCRTStartup
===================================================
I try change Entry-point symbol to "wWinMainCRTStartup", but there is still link error
===================================================
corelibc.lib(wwinmain.obj) : error LNK2019: unresolved external symbol wWinMain referenced in function wWinMainCRTStartup
===================================================
Can help me solve this problem? Thank you very much.
http://www.tech-archive.net/Archive/Win ... /0504.html
I can't build it successly, and I don't know how to do.I really want to know how can measure CPU load on PDA, because My school homework project is the PDA CPU monitor. Please help me, thank you very much.
- Code:
#include "windows.h"
#include "Tlhelp32.h"
void SumThreadTimes()
{
HANDLE hThreads = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
int newKernel =0;
int newUser =0;
if(hThreads)
{
THREADENTRY32 entry;
entry.dwSize = sizeof(THREADENTRY32);
BOOL more = Thread32First(hThreads, &entry;);
if(!more) return;
FILETIME creation, exit, kernel, user;
// add up times from all threads
while(more)
{
if(GetThreadTimes( (HANDLE) entry.th32ThreadID , &creation;,
&exit;, &kernel;, &user;)==0)
{ // HERE THE CALL RETURNS INVALID_HANDLE
break;
}
//try we LowBytes, High Bytes keep inchangeable most of the time
newKernel += kernel.dwLowDateTime;
newUser += user.dwLowDateTime;
entry.dwSize = sizeof(THREADENTRY32);
more = Thread32Next(hThreads, &entry;);
}
CloseToolhelp32Snapshot(hThreads);
}
}
build will make some error, like this
===================================================
corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function WinMainCRTStartup
===================================================
I try change Entry-point symbol to "wWinMainCRTStartup", but there is still link error
===================================================
corelibc.lib(wwinmain.obj) : error LNK2019: unresolved external symbol wWinMain referenced in function wWinMainCRTStartup
===================================================
Can help me solve this problem? Thank you very much.