C Run-Time Error R6016 not enough space for thread dataThe program did not receive enough memory from the operating system to complete a _beginthread call.When a new thread is started, the library must create an internal database for the thread. If the database cannot be expanded with memory provided by the operating system, the thread will not begin and the calling process will stop
我怀疑你的线程函数有问题,可以的话贴出来看一下.//按照你提供的部分代码,我做了如下测试未见异常. //Declare member variable m_pThread in MainFrm.h CWinThread *m_pThread; //Declare thread function in MainFrm.cpp UINT NewThreadGetResuilt( LPVOID pParam );//the function is realized by your provider void CMainFrame::OnTest() { m_pThread= AfxBeginThread(NewThreadGetResuilt,this,THREAD_PRIORITY_BELOW_NORMAL,0,CREATE_SUSPENDED); m_pThread->m_bAutoDelete=FALSE; m_pThread->ResumeThread(); }//the thread function; UINT NewThreadGetResuilt( LPVOID pParam ) { AfxMessageBox("Maybe this function has some question!"); return 0L; }
not enough space for thread dataThe program did not receive enough memory from the operating system to complete a _beginthread call.When a new thread is started, the library must create an internal database for the thread. If the database cannot be expanded with memory provided by the operating system, the thread will not begin and the calling process will stop
//m_pThread = AfxBeginThread(NewThreadGetResuilt,this,THREAD_PRIORITY_BELOW_NORMAL,0,CREATE_SUSPENDED);
//m_pThread->m_bAutoDelete=FALSE;
//m_pThread->ResumeThread();依然出现同样错误!!!!
除非连线程函数里的代码全部注释掉,才能运行,为什么?
//Declare member variable m_pThread in MainFrm.h
CWinThread *m_pThread;
//Declare thread function in MainFrm.cpp
UINT NewThreadGetResuilt( LPVOID pParam );//the function is realized by your provider
void CMainFrame::OnTest()
{
m_pThread= AfxBeginThread(NewThreadGetResuilt,this,THREAD_PRIORITY_BELOW_NORMAL,0,CREATE_SUSPENDED);
m_pThread->m_bAutoDelete=FALSE;
m_pThread->ResumeThread();
}//the thread function;
UINT NewThreadGetResuilt( LPVOID pParam )
{
AfxMessageBox("Maybe this function has some question!");
return 0L;
}
应该是 UINT __stdcall NewThreadGetResuilt( LPVOID pParam );