我定义了一个定时器函数,调用如下:
SetTimer(1, 1000, Timer_proc);
VOID CALLBACK Timer_proc(HWND hwnd, UINT message, UINT iTimerID, DWORD dwTime)
{
//其他操作
}编译时出错,如下:error C2664: 'SetTimer' : cannot convert parameter 3 from 'void (struct HWND__ *,unsigned int,unsigned int,unsigned long)' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
SetTimer(1, 1000, Timer_proc);
VOID CALLBACK Timer_proc(HWND hwnd, UINT message, UINT iTimerID, DWORD dwTime)
{
//其他操作
}编译时出错,如下:error C2664: 'SetTimer' : cannot convert parameter 3 from 'void (struct HWND__ *,unsigned int,unsigned int,unsigned long)' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
HWND hWnd, // handle of CWnd that called SetTimer
UINT nMsg, // WM_TIMER
UINT nIDEvent, // timer identification
DWORD dwTime // system time
)
{
}
没有问题
映射wm_timer消息,然后在ontimer 函数里操作。。
关注......