一个关于WINDOWS平台下控制台程序中的时钟使用问题,帮忙看看下面程序哪里出错了
#include "stdafx.h"
VOID CALLBACK TimerProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_TIMER message
UINT idEvent, // timer identifier
unsigned long dwTime // current system time
)
{
printf("Hello Timer!\n");
}
int main(int argc, char* argv[])
{
printf("Hello\n");
UINT id = ::SetTimer(NULL,0,100,TimerProc);
printf("settimer=%u\n",id);
//printf("Hello World!\n");
DWORD dwRet = GetLastError();
getchar();
::KillTimer(NULL,id);
return 0;
}