error C3867 in MFC
-
i try to start another thread with this code CGLMFCDlg * MyThread= new CGLMFCDlg; _beginthread(MyThread->Thread, 0,NULL); delete MyThread; the new thread is a void function, i get a error message as follows: error C3867: 'CGLMFCDlg::Thread': function call missing argument list; use '&CGLMFCDlg::Thread' to create a pointer to member Any sugestions on how i can solve this? thanks
-
i try to start another thread with this code CGLMFCDlg * MyThread= new CGLMFCDlg; _beginthread(MyThread->Thread, 0,NULL); delete MyThread; the new thread is a void function, i get a error message as follows: error C3867: 'CGLMFCDlg::Thread': function call missing argument list; use '&CGLMFCDlg::Thread' to create a pointer to member Any sugestions on how i can solve this? thanks
For an address of a member function the compiler is expecting you to use the address-of operator: _beginthread(&MyThread::Thread, 0,NULL);
-
For an address of a member function the compiler is expecting you to use the address-of operator: _beginthread(&MyThread::Thread, 0,NULL);
that gives me an error like this error C2664: '_beginthread' : cannot convert parameter 1 from 'void (__thiscall CGLMFCDlg::* )(void)' to 'void (__cdecl *)(void *)' 1> There is no context in which this conversion is possible
-
that gives me an error like this error C2664: '_beginthread' : cannot convert parameter 1 from 'void (__thiscall CGLMFCDlg::* )(void)' to 'void (__cdecl *)(void *)' 1> There is no context in which this conversion is possible
The thread proc needs to be defined correctly. For a member function it needs to be declared static. Mark
-
i try to start another thread with this code CGLMFCDlg * MyThread= new CGLMFCDlg; _beginthread(MyThread->Thread, 0,NULL); delete MyThread; the new thread is a void function, i get a error message as follows: error C3867: 'CGLMFCDlg::Thread': function call missing argument list; use '&CGLMFCDlg::Thread' to create a pointer to member Any sugestions on how i can solve this? thanks
-
It looks like your using MFC, so why not use
AfxBeginThread
? No big difference though :). And are you sure MyThread->Thread is static?
:Gong: 歡迎光臨 吐 西批 :Gong:
thanks, that solves it ;)