16,505
社区成员
发帖
与我相关
我的任务
分享
afx_msg LRESULT OnThreadMessage(WPARAM wParam, LPARAM lParam);
LRESULT CConnectThread::OnThreadMessage(WPARAM wParam, LPARAM lParam)
{
switch(wParam)
{
case 0: // destroy data socket
m_ConnectSocket.DestroyDataConnection();
break;
case 1: // quit !
PostThreadMessage(WM_QUIT,0,0);//关闭线程
break;
default:
break;
}
return 0L;
}
映射
BEGIN_MESSAGE_MAP(CConnectThread, CWinThread)
//{{AFX_MSG_MAP(CConnectThread)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
ON_MESSAGE(WM_THREADMSG, OnThreadMessage)
END_MESSAGE_MAP()