typedef unsigned (__stdcall CAdapterObj::* Fun )( void );
typedef unsigned (__stdcall * pThread )( void * );
Fun func = (Fun)&CAdapterObj::ThreadFun;
DWORD dwAddress;
memcpy(&dwAddress,&func ,sizeof(func ));
pThread pThrd;
memcpy(&pThrd, &dwAddress, sizeof(pThrd));
HANDLE handle = (HANDLE) _beginthreadex(NULL,0,pThrd, reinterpret_cast< void* >(this) ,0,NULL);