BOOL GetExitCodeThread( HANDLE hThread, // handle to the thread LPDWORD lpExitCode // termination status);你确认CWinThread *m_pThread;可以当HANDLE用?还有你结束线程要看这句 To end the thread, call AfxEndThread from within the thread, or return from the controlling function of the worker thread. 也就是说你按了结束线程按钮,这个AfxEndThread(ExitCode,true); 要在你的工作线程里执行的
BOOL GetExitCodeThread( HANDLE hThread, // handle to the thread
LPDWORD lpExitCode // termination status);你确认CWinThread *m_pThread;可以当HANDLE用?还有你结束线程要看这句
To end the thread, call AfxEndThread from within the thread, or return from the controlling function of the worker thread.
也就是说你按了结束线程按钮,这个AfxEndThread(ExitCode,true); 要在你的工作线程里执行的
GetExitCodeThread(m_pThread,&ExitCode);
//p为需要销毁的CWindThreadZ指针,其在创建线程时可以拿到.
if(ExitCode>0 )
AfxEndThread(ExitCode,true);
ExitCode 返回值等于0