MFC c++如何在基于对话框程序中添加一个新的线程?我这样写程序失败,谁能帮帮?只是想在创建窗口的时候执行
BOOLCTEST_THREADDlg::OnInitDialog(){CDialogEx::OnInitDialog();.......HANDLEhThread1;h...
BOOL CTEST_THREADDlg::OnInitDialog(){ CDialogEx::OnInitDialog();
.......
HANDLE hThread1; hThread1 = CreateThread(NULL, 0, ThreadProc1, NULL, 0, NULL); CloseHandle(hThread1); return TRUE; // 除非将焦点设置到控件,否则返回 TRUE}
......
DWORD WINAPI ThreadProc1(LPVOID lpParameter){ AfxMessageBox(_T("hello")); return 0;} 展开
.......
HANDLE hThread1; hThread1 = CreateThread(NULL, 0, ThreadProc1, NULL, 0, NULL); CloseHandle(hThread1); return TRUE; // 除非将焦点设置到控件,否则返回 TRUE}
......
DWORD WINAPI ThreadProc1(LPVOID lpParameter){ AfxMessageBox(_T("hello")); return 0;} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询