AfxBeginThread & CreateThread
Heya
I was attempting to create a thread inside of a class as so:
Code:
SomeClass::DoWork()
{
::AfxBeginThread(ThreadProc, NULL);
}
UINT SomeClass::ThreadProc(LPVOID pArg)
{
//work...
return TRUE;
}
also I tried to
Code:
SomeClass Instance;
::AfxBeginThread(&Instance.ThreadProc, NULL);
Basically I'm wondering is it possible in C++ to create a thread inside your object, or create a thread running an objects method? In C# this is no problem, I just cant seem to find any examples of doing this in C++ without making a seperate function outside of a class, or making the class's method static.
Thanks for any info.