Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
创建多线程 我在VS2008中使用多线程方法,使用C++语言。当我使用\u beginthreadex函数时,我得到以下错误: error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int (__stdcall *)(void *)' to 'unsigned int (__stdcall *)(void *)'_C++_Visual Studio 2008_Compiler Errors - Fatal编程技术网

创建多线程 我在VS2008中使用多线程方法,使用C++语言。当我使用\u beginthreadex函数时,我得到以下错误: error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int (__stdcall *)(void *)' to 'unsigned int (__stdcall *)(void *)'

创建多线程 我在VS2008中使用多线程方法,使用C++语言。当我使用\u beginthreadex函数时,我得到以下错误: error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int (__stdcall *)(void *)' to 'unsigned int (__stdcall *)(void *)',c++,visual-studio-2008,compiler-errors,C++,Visual Studio 2008,Compiler Errors,ps:我在threadFunc上使用的模板如下: 模板 无符号整型WINAPI ClosingFunc(void*pvPara) {…} ,然后我创建线程 _beginthreadex(NULL,0,closingReconstruction_ThreadFunc<T>,(PVOID)(tPara+i),0,NULL) \u beginthreadex(NULL,0,closing)ThreadFunc,(PVOID)(tPara+i),0,NULL) 所以我得到了这个错误,当然

ps:我在threadFunc上使用的模板如下:

模板
无符号整型WINAPI ClosingFunc(void*pvPara)
{…}

,然后我创建线程

_beginthreadex(NULL,0,closingReconstruction_ThreadFunc<T>,(PVOID)(tPara+i),0,NULL)
\u beginthreadex(NULL,0,closing)ThreadFunc,(PVOID)(tPara+i),0,NULL)

所以我得到了这个错误,当然,如果我删除模板,它可以工作,但我需要使用模板,有什么方法可以解决这个问题。

您忘记提到前面的错误消息

错误C2065:“T”:未声明的标识符

让我声明,首先查看第一条错误消息通常是一个好主意


干杯,嗯。,

你能发布产生问题的代码吗?这是一条非常不寻常的错误消息。您有一些触发此的示例代码吗?
\u beginthreadex
之前的下划线表示它是内部的。@Dani:一般来说是正确的,但在MSVC中,IIRC确实是生成线程的标准函数。@Dani:许多特定于平台的CRT函数都有一个前导下划线。以前导下划线开头的名称保留给实现使用。如果这确实是问题所在,那么它绝对值得使用。这绝对是个好猜测。