void CWindow::SpawnThread( void *functPtr )
{
HANDLE hGameLoopThread; // Main Thread handle
DWORD tid;
hGameLoopThread = CreateThread( 0, 0, functPtr, 0, 0, &tid);
}
CreateThread wrapper method
I can't quite seem to get this to work.
I figure I pass a pointer to the function and then give that to the CreateThread function, and it should work right?
Well... here's what I have now.
And here's the error that I've been getting.
Compiling...
CWindow.cpp
C:\Documents and Settings\Daniel Charette\Desktop\New builder\CWindow.cpp(147) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'void *' to 'unsigned long (__stdcall *)(void *)'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
I know that it's probably just casting it into something else but I haven't been able to figure out what I should cast it to. I would really appriciate any idea's.
I tried using an unsigned long and I even tried 'unsigned long (__stdcall *)(void *)' but of course this didn't work
[edited by - zyroth on December 20, 2002 10:43:04 PM]
You can use the
LPTHREAD_START_ROUTINE
typedef which is defined in <windows.h>. If I had my way, I''d have all of you shot! codeka.com - Just click it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement