class CDemo
{
public:
static DWORD WINAPI ThreadStub(LPVOID Parameter)
{
((CDemo*)Parameter)->Thread();
}
void Thread()
{
for(int i=0;i<100;i++)
{
cout<<"Worker Thread: iteration n. "<<i<<endl;
}
}
};
{
public:
static DWORD WINAPI ThreadStub(LPVOID Parameter)
{
((CDemo*)Parameter)->Thread();
}
void Thread()
{
for(int i=0;i<100;i++)
{
cout<<"Worker Thread: iteration n. "<<i<<endl;
}
}
};
int main(int argc, char* argv[])
{
CDemo c;
DWORD Dummy;
HANDLE h=CreateThread(NULL,NULL,CDemo::ThreadStub,&c,NULL,&Dummy);
WaitForSingleObject(h,INFINITE);
return 0;
}