15,471
社区成员
发帖
与我相关
我的任务
分享
CSocket socketObj;
DWORD WINAPI ThreadProc(LPVOID lpParam)
{
socketObj.Attach((SOCKET)sock);
//.....
//.....
socketObj.Close ();
return 0;
}
void CUIxxoo::OnOK()
{
socketObj.Create();
SOCKET hSocket = socketObj.Detach();
DWORD id(0);
::CreateThread(NULL,0,ThreadProc,(LPVOID)hSocket,0,&id);
}
哎,你直接用socket裸写就不行吗?