开发者

create multi-thread

开发者 https://www.devze.com 2023-04-05 13:49 出处:网络
I use Multi-thread method in vs2008 ,use c++ language.when I use _beginthreadex function, I got the follow error:

I use Multi-thread method in vs2008 ,use c++ language. when I use _beginthreadex function, I got the follow error:

error C2664: '_beginthreadex' : cannot convert parameter 3 from 'unsigned int
(__stdcall *)(void *)' to 'unsigned int (__stdcall *)(void *)'
开发者_StackOverflow社区

ps: I use the template on the threadFunc like this:

template<class T> unsigned int WINAPI closingReconstruction_ThreadFunc(void* pvPara) {...}

,and then i creat the thread

_beginthreadex(NULL,0,closingReconstruction_ThreadFunc<T>,(PVOID)(tPara+i),0,NULL)

so i get this error , of course , if I remove the template ,it can be work,but i need to use template, are there any methods to solve this.


You forgot to mention the immediately preceding error message,

error C2065: 'T' : undeclared identifier

Let me just state that looking at the first error message first, is generally a good idea.

Cheers & hth.,

0

精彩评论

暂无评论...
验证码 换一张
取 消