Hello ,
I have the following code :
//...additional includes cut off
class MyThread{
public:
DWORD WINAPI ThreadProc( LPVOID lpParameter );
void run();
};
DWORD WINAPI MyThread::Threa dProc(LPVOID lpParameter){
cout<<"Thread called\n";
return 0;
}
void MyThread::run() {
CreateThread(NU LL, 0, MyThread::Threa dProc, NULL, 0, NULL); //<---
LINE
}
void main(void){
MyThread p;
p.run();
}
When i compile this ( with MSVS 2005 ) i get the following compile
error:
LINE: error C3867: 'MyThread::Thre adProc': function call missing
argument list; use '&MyThread::Thr eadProc' to create a pointer to
member.
Then I add &MyThread:Threa dProc instead of MyThread::Threa dProc and i
get another compile error:
LINE: error C2664: 'CreateThread' : cannot convert parameter 3 from
'DWORD (__stdcall MyThread::* )(LPVOID)' to 'LPTHREAD_START _ROUTINE'
Any logic explanation?
Thank-you ,
Daniel
I have the following code :
//...additional includes cut off
class MyThread{
public:
DWORD WINAPI ThreadProc( LPVOID lpParameter );
void run();
};
DWORD WINAPI MyThread::Threa dProc(LPVOID lpParameter){
cout<<"Thread called\n";
return 0;
}
void MyThread::run() {
CreateThread(NU LL, 0, MyThread::Threa dProc, NULL, 0, NULL); //<---
LINE
}
void main(void){
MyThread p;
p.run();
}
When i compile this ( with MSVS 2005 ) i get the following compile
error:
LINE: error C3867: 'MyThread::Thre adProc': function call missing
argument list; use '&MyThread::Thr eadProc' to create a pointer to
member.
Then I add &MyThread:Threa dProc instead of MyThread::Threa dProc and i
get another compile error:
LINE: error C2664: 'CreateThread' : cannot convert parameter 3 from
'DWORD (__stdcall MyThread::* )(LPVOID)' to 'LPTHREAD_START _ROUTINE'
Any logic explanation?
Thank-you ,
Daniel
Comment