我定义了一个定时器函数,调用如下:
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)'

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/4185/4185260.xml?temp=8.204287E-02
      

  2.   

    void CALLBACK  TimerProc(
       HWND hWnd,      // handle of CWnd that called SetTimer
       UINT nMsg,      // WM_TIMER
       UINT nIDEvent,   // timer identification
       DWORD dwTime    // system time
       )
    {
    }
    没有问题
      

  3.   

    嘿嘿,我也是初学者,你可以试试下面的方法 ,
    映射wm_timer消息,然后在ontimer 函数里操作。。
      

  4.   

    从错误的提示上看,你是调用了设置时间的API函数UINT SetTimer(HWND hWnd,UINT nIDEvent,UINT uElapse,TIMERPROC lpTimerFunc);,没有声明与定时器相关的窗口,函数参数匹配错误
      

  5.   

    我一直是在OnTimer里做的,没想到这样也行
    关注......