我在 microsoft visual studio c++ 10 express 中遇到 _beginthread 问题:我的代码:
void __cdecl DashThread( void * Args ) // function without any class refs
{
while(1){
MessageBox::Show("work");
Sleep(5000);
}
_endthread();
}
private:
System::Void button8_Click_1(System::Object^ sender, System::EventArgs^ e) {
HANDLE HDash = ( HANDLE ) _beginthread(DashThread, 0, NULL );
}
和错误:
错误 C3641:“DashThread”:使用 /clr:pure 或 /clr:safe 编译的函数的调用约定“__cdecl”无效
错误 C2664:“ beginthread”:无法将参数 1 从“void ( _cdecl *)(void *)”转换为“void (__cdecl *)(void *)”