Could AfxBeginThread not run in a dll?
-
I create a mfc regular dll and run the AfxBeginThread function in it. As soon as I run this function ,there is a error . Why?
-
void CYiCltDllApp::Start() { m_proxyServer.bRun = TRUE; m_proxyServer.m_Info.hWnd = m_hWnd; m_proxyServer.m_Info.nPort = m_nPort; // local m_proxyServer.m_sitebase =m_sitebase; m_proxyServer.m_IpAddress =m_IpAddress; m_proxyServer.m_BufferRoot =m_RecvBuffer; if(m_hWnd!=NULL) { AfxBeginThread(StartThread, (LPVOID)&m_proxyServer, THREAD_PRIORITY_BELOW_NORMAL); } }
-
void CYiCltDllApp::Start() { m_proxyServer.bRun = TRUE; m_proxyServer.m_Info.hWnd = m_hWnd; m_proxyServer.m_Info.nPort = m_nPort; // local m_proxyServer.m_sitebase =m_sitebase; m_proxyServer.m_IpAddress =m_IpAddress; m_proxyServer.m_BufferRoot =m_RecvBuffer; if(m_hWnd!=NULL) { AfxBeginThread(StartThread, (LPVOID)&m_proxyServer, THREAD_PRIORITY_BELOW_NORMAL); } }
-
After debug in StartThread function by set break point, I found that the program do not step into the StartThread function.
-
After debug in StartThread function by set break point, I found that the program do not step into the StartThread function.
-
What is returned by
AfxBeginThread
? Does it help to set the priority toTHREAD_PRIORITY_NORMAL
? ~RaGE(); -
not static. At first,I set it as a member of CYiCltDllApp. Then set it as a independent function.
-
If it is not null, then the thread was created (AfxBeginThread returns a CWinThread object). ~RaGE();