在Win32 DLL项目中增加线程运行时错误

时间:2013-01-31 07:01:58

标签: c++ visual-c++ boost-thread

我正在使用C ++ DLL项目。我试着在那里使用简单的boost线程。这是源代码。 uploadThread = boost::thread(uploadFileThread);行的此运行时异常。有什么想法吗?

Unhandled exception at 0x6fa1bd89 (Controller.dll) in UserInterfaces.exe: 0xC0000005: Access violation reading location 0xbaadf05d.

或者Controller.h

namespace controller{
class  CController {
public: 
boost::thread uploadThread;
}
}

Controller.cpp

namespace controller{
static void uploadFileThread(){}
void CController::StartFileUpload(){        
        uploadThread = boost::thread(uploadFileThread);
        uploadThread.join();
}
}

的main.cpp

int main(){
controller::CController my_Controller;
my_Controller.StartFileUpload();
return 0;
}

0 个答案:

没有答案