,error C2440: 'type cast': cannot convert from '' to 'void (_stdcall *)

救命啊,error C2440: 'type cast': cannot convert from '' to 'void (__stdcall *)
我定义了一个类,需要在类中使用定时器,由于没有使用MFC,因此使用的windows底层接口。
C/C++ code

#include <winsock2.h>
#include <windows.h>
#include <queue>
#include <stdio.h>

using namespace std;

class CVCTComTask  
{
public:
    int AudmComTask();
public:
    HANDLE            m_MsgHandle;
    HANDLE            m_tmHandle;
    int            m_TpaRecvTimer;
    int            m_TpaHandShakeTimer;
    int            m_TpaSendAddrTimer;
public:
    DWORD WINAPI winVctMsgTask(LPVOID lpParameter);
    int TimerTask();
    int RecvTimer();    
    int SendTimer();
    int HartTimer();
        int ReceiveMessage(MESSAGE& NewMsg);
};



//CVCTComTask.cpp--------------------------------------
C/C++ code
int CVCTComTask::AudmComTask() 
{
[color=#FF0000]m_MsgHandle = CreateThread(NULL, 0,(LPTHREAD_START_ROUTINE )VctMsgTask,NULL, 0, NULL);
m_tmHandle = CreateThread(NULL, 0,(LPTHREAD_START_ROUTINE )TimerTask,NULL, 0, NULL);[/color]
return 1;
}

int  CVCTComTask::VctMsgTask()
{
MESSAGE stMsg;
int flag = 0;
while (1)
{
flag = 0;
flag = ReceiveMessage(stMsg);
if (1 == flag)
{
continue;
}

//processMsg(stMsg);
memset(&stMsg, 0, sizeof(stMsg));
Sleep(1);
}
return 0;
return 1;
}

int CVCTComTask::TimerTask()
{

MSG msg;
printf("Start Get Timer!!!\n");
/* 收包 定时器*/

[color=#FF0000]m_TpaRecvTimer = SetTimer(NULL, 1, 50, (TIMERPROC)RecvTimer);[/color]

[color=#FF0000]m_TpaSendAddrTimer = SetTimer(NULL, 2, 10000, (TIMERPROC)SendTimer);[/color]
while(GetMessage(&msg,NULL,0,0))
{
if (1 == m_hflag)
{
[color=#FF0000]m_TpaHandShakeTimer= SetTimer(NULL,3,500,(TIMERPROC)HartTimer);[/color]
m_hflag = 0;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
Sleep(1);
}
return 1;
}

出现了5个这样的错误。
error C2440: 'type cast' : cannot convert from '' to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
程序中希望实现创建两个线程,一个用于接收定时器消息,一个用于接收队列消息。
但在线程的创建以及定时器的启动时出现错误。


------解决方案--------------------
定时器函数是回调函数,回调函数要么是全局函数,要么是静态函数。完毕
------解决方案--------------------
TimerTask是成员函数_thisCall调用约定
需要全局或者静态函数
------解决方案--------------------
++
探讨
定时器函数是回调函数,回调函数要么是全局函数,要么是静态函数。完毕