Multithreading 在thread类中,我们应该在哪里编写原始的thread函数
我阅读了CWinThread教程,发现从CWinThread派生的类可以在AfxBeginThread中使用。请告诉我应该在哪里(在哪个函数下)写入线程逻辑,或者哪个是UINT MyControl函数(LPVOID pParam)的替代方案;在CWinThread类内部 问候,Multithreading 在thread类中,我们应该在哪里编写原始的thread函数,multithreading,visual-c++,mfc,Multithreading,Visual C++,Mfc,我阅读了CWinThread教程,发现从CWinThread派生的类可以在AfxBeginThread中使用。请告诉我应该在哪里(在哪个函数下)写入线程逻辑,或者哪个是UINT MyControl函数(LPVOID pParam)的替代方案;在CWinThread类内部 问候, John.通常在类成员函数中编写线程函数逻辑 UINT CMyThread::ThreadProc( LPVOID param ) { CMyClass * pInstance = reinterpret_cast
John.通常在类成员函数中编写线程函数逻辑
UINT CMyThread::ThreadProc( LPVOID param )
{
CMyClass * pInstance = reinterpret_cast<CMyClass*>(param);
return pInstance->DoMyLogic();
}
UINT CMyThread::ThreadProc(LPVOID参数)
{
CMyClass*pInstance=重新解释铸件(参数);
返回pInstance->DoMyLogic();
}
如果我理解你的问题