Having have a little problem where I can call a thread- creation function in a procedural program but not from within a class?
Code:
#include <include.h>
#include <windows.h>
THREADFUNC foo(char* buff )
{
int len = strlen(buff);
int i, j;
for(j = 0; j < 3; j++)
{
for(i = 0; i < len; i++)
{
PrintCtr("Buff[%i]: %c", i, buff[i]);
}
Sleep(1000);
}
}
int main()
{
char b[] = "One";
char c[] = "Two";
THREAD t = NULL;
THREAD v = NULL;
halt();
t = NewThread( foo, b );
v = NewThread( foo, c );
while(ThreadIsActive(t) && ThreadIsActive(v) ); //...wait...
CloseHandle(t);
CloseHandle(v);
return 0;
}