class SIPVoIPLink
{
private:
static unsigned __stdcall ReceivingThrd(void * pParam);
}
//sipvoiplink.cpp
#include <Winsock2.h>
#include <process.h>
bool SIPVoIPLink::init()
{
......
HANDLE hThread;
unsigned threadID;
hThread = (HANDLE)_beginthreadex( NULL, 0, &SIPVoIPLink::ReceivingThrd, (LPVOID)this, 0, &threadID );
if(hThread == NULL)
return false;
}
unsigned __stdcall SIPVoIPLink::ReceivingThrd(void * pParam)
{
//getEvent();
((SIPVoIPLink *)pParam)->getEvent();
return 0;
}
转自:http://hi.baidu.com/qinpc/blog/item/5aaa8b54918e541b3a2935ee.html