开发者

create multi-thread

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜