Hello,
I got some problem with the CreateThread(...) function.
Oke, here is my situation:
// Header
class Dinges
{
public:
void Start();
DWORD WINAPI Run(LPVOID);
void Stop();
private:
HANDLE Thread;
DWORD ThreadID;
}
// Code
void Dinges::Start()
{
LPTHREAD_START_ROUTINE Temp;
Temp = Run; // <-- Error is refering to this line
Thread = CreateThread(NULL, 0, Temp, NULL, 0, &dwThreadID);
}
void Dinges::Stop()
{
TerminateThread(Thread, 0);
}
DWORD WINAPI DINGES::Run(LPVOID lpParam)
{
// Do something
}
To give a bit more information about
LPTHREAD_START_ROUTINE is defined:
// winbase.h
typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(
LPVOID lpThreadParameter
);
typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
I get the following error:
error C2440: '=' : cannot convert from 'DWORD (__stdcall Input::* )(void *)' to 'LPTHREAD_START_ROUTINE'
There is no context in which this conversion is possible
Can anyone point where I'm doing wrong, please?
Thank you,
Xeile