急!为什么在模式对话框创建后,在它的初始化函数中得不到它的句柄?我想要把它传入一个线程中去,代码如下
structRECVPARAM{SOCKETsock;HWNDhwnd;}BOOLCchatinwinDlg::OnInitDialog(){RECVPARAM*pRec...
struct RECVPARAM
{
SOCKET sock;
HWND hwnd;
}
BOOL CchatinwinDlg::OnInitDialog()
{
RECVPARAM *pRecvParam = new RECVPARAM;
pRecvParam->sock = m_socket;
pRecvParam->hwnd = this->m_hWnd; (这里得不到句柄(unuse:expression connot be evaluated.))
HANDLE hThread = CreateThread(NULL,0,RecvProc,(LPVOID)pRecvParam,0,NULL);
CloseHandle(hThread);
}
}
请问问题出在哪,谢谢各位.
你是指我在CchatinwinDlg类里的HWDN成员变量写错了? 展开
{
SOCKET sock;
HWND hwnd;
}
BOOL CchatinwinDlg::OnInitDialog()
{
RECVPARAM *pRecvParam = new RECVPARAM;
pRecvParam->sock = m_socket;
pRecvParam->hwnd = this->m_hWnd; (这里得不到句柄(unuse:expression connot be evaluated.))
HANDLE hThread = CreateThread(NULL,0,RecvProc,(LPVOID)pRecvParam,0,NULL);
CloseHandle(hThread);
}
}
请问问题出在哪,谢谢各位.
你是指我在CchatinwinDlg类里的HWDN成员变量写错了? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询