vc++ MFC多线程 请给个按下按钮弹出个"Hello World"的多线程,要在MFC下的,如果有挂起线程,结束线程. 20
展开全部
UINT SendDataThread(LPVOID lpParam);
UINT SendSetThread(LPVOID lpParam);
CxxDlg::OnBTN1()
{
AfxBeginThread(SendDataThread,this,THREAD_PRIORITY_NORMAL);
}
CxxDlg::OnBTN2()
{
AfxBeginThread(SendSetThread,this,THREAD_PRIORITY_NORMAL);
}
UINT SendDataThread(LPVOID lpParam)
{
CxxDlg *pDlg=(CxxDlg *)lpParam;
AfxMessageBox("Hello Word");
return 0;
}
UINT SendSetThread(LPVOID lpParam)
{
Cxx*sDlg=(CxxDlg *)lpParam;
AfxMessageBox("Hello Word");
return 0;
}
UINT SendSetThread(LPVOID lpParam);
CxxDlg::OnBTN1()
{
AfxBeginThread(SendDataThread,this,THREAD_PRIORITY_NORMAL);
}
CxxDlg::OnBTN2()
{
AfxBeginThread(SendSetThread,this,THREAD_PRIORITY_NORMAL);
}
UINT SendDataThread(LPVOID lpParam)
{
CxxDlg *pDlg=(CxxDlg *)lpParam;
AfxMessageBox("Hello Word");
return 0;
}
UINT SendSetThread(LPVOID lpParam)
{
Cxx*sDlg=(CxxDlg *)lpParam;
AfxMessageBox("Hello Word");
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询