I am trying to create a private CreateThread function which I can't get to compile.
error C3867: 'Thread::testThread': function call missing argument list; use '&Thread::testThread' to create a pointer to member
I have Googled this but can't understand what is going on.
#include<windows.h>
#include<iostream>
class Thread
{
public:
Thread()
{
}
~Thread()
{
}
void something()
{
CreateThread(0,0,testThread,0,0,0);
}
private:
DWORD WINAPI testThread(LPVOID args)
{
while(true)
{
std::cout<<"test\r\n";
Sleep(500);
}
return 0;
}
};
If I put DWORD WINAPI testThread(LPVOID args) outside the class it compiles ok.
I also tried CreateThread(0,0,&Thread::testThread,0,0,0);
Any help would be awesome