我想知道是否在C++中为线程方法使用beginthread或QueueUserWorkItem。这两个API之间有什么区别,它们在哪些方面更适合? 感谢, BTW,我已经阅读了这个问题Windows threading: _beginthread vs _beginthreadex vs CreateThread C++
我有下面的代码来启动一个新线程 int number = 10;
_beginthread(ModbusReadWrite, 0, (void*)number);
功能是: 它显示了一个错误: error C2440: 'initializing' : cannot convert from 'void **' to 'int'
所以,我需要定义int类型的新参数并将其传递给Mod
我在使用在Microsoft Visual Studio C++ 10所明示_beginthread一个问题: 我的代码: void __cdecl DashThread(void * Args) // function without any class refs
{
while(1){
MessageBox::Show("work");
Sleep(5000