How can you even compile your code (there are a lot of errors)? The following one works properly
#include <windows.h>
class SimpleThread
{
static DWORD WINAPI ThreadFunc(LPVOID p)
{
while(1)
{
printf("Test");
}
}
public:
void SimpleThread::Start()
{
DWORD dwThreadId, dwThrdParam = 1;
HANDLE threadHandle;
threadHandle = CreateThread(
NULL,
0,
ThreadFunc,
&dwThrdParam,
0,
&dwThreadId);
}
};
void main()
{
SimpleThread t;
t.Start();
while (1);
}
:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]