关于启动类属成员函数作线程执行体的问题
UINT Robot::RobotMotionOnTracj(LPVOID pParam)
{
return NULL;
}
UINT Robot::RobRandMotionThread(LPVOID pParam)
{
return NULL;
}
void Robot::RobotMotion(int mode)
{
if (mode == 1)
{
_beginthreadex(NULL,0,(unsigned int (__stdcall *)(void *))RobRandMotionThread,(void *)this,NULL,RandThreadID);
return;
}
if (mode == 2)
{
_beginthreadex(NULL,0,(unsigned int(__stdcall *)(void *))RobotMotionOnTracj,0,&TaskAim,RandThreadID);
return;
}
}
代码如上
我已经在设置里设置了使用多线程动态库
可是编译的时候提示
E:\程序project\ACS\Robot.cpp(41) : error C2440: 'type cast' : cannot convert from '' to 'unsigned int (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
E:\程序project\ACS\Robot.cpp(46) : error C2440: 'type cast' : cannot convert from '' to 'unsigned int (__stdcall *)(void *)'
None of the functions with this name in scope match the target type
-----------------------------------------------------------
为什么??