back again with yet another question (this visual C business is rather odd)
ok so when i create a thread using
the NewThread function usually looks like this
however if i create a thread from within a class
now to keep the NewThread associated with the class i tried
however using
causes errors. (cannot convert parameter 3 from unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)
q: is what im trying even possible?
any help greatly appreciated.
(PS. the code works in a console app, but im trying to write it into a class)
If somethings hard to do, its not worth doing - Homer Simpson
ok so when i create a thread using
Code:
hThread=CreateThread(NULL,0,NewThread,0,0,&dwThreadID));
the NewThread function usually looks like this
Code:
DWORD _stdcall NewThread(void *param)
{
....some code....
return 0;
}
however if i create a thread from within a class
Code:
SomeClass::SomeClass()
{
....code....
hThread=CreateThread(NULL,0,SomeClass::NewThread,0,0,&dwThreadID));
}
now to keep the NewThread associated with the class i tried
Code:
DWORD _stdcall SomeClass::NewThread(void *param)
{
....do stuff here....
return 0;
}
however using
Code:
hThread=CreateThread(NULL,0,SomeClass::NewThread,0,0,&dwThreadID));
causes errors. (cannot convert parameter 3 from unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)
q: is what im trying even possible?
any help greatly appreciated.
(PS. the code works in a console app, but im trying to write it into a class)
If somethings hard to do, its not worth doing - Homer Simpson