Calling The Thread function
-
UNIT SimpleThread::ThreadFunc(LPARAM lp) { While(1) { printf("Test"); } } SimpleThread::Start() { DWORD dwThreadId, dwThrdParam = 1; threadHandle = CreateThread( NULL, 0, SimpleThread::ThreadFunc, dwThrdParam, 0, &dwThreadId); } When call the thread it does't get called. Also somtimes it called but the while loop terminate within a while.Can any give me solution to this
-
UNIT SimpleThread::ThreadFunc(LPARAM lp) { While(1) { printf("Test"); } } SimpleThread::Start() { DWORD dwThreadId, dwThrdParam = 1; threadHandle = CreateThread( NULL, 0, SimpleThread::ThreadFunc, dwThrdParam, 0, &dwThreadId); } When call the thread it does't get called. Also somtimes it called but the while loop terminate within a while.Can any give me solution to this
-
UNIT SimpleThread::ThreadFunc(LPARAM lp) { While(1) { printf("Test"); } } SimpleThread::Start() { DWORD dwThreadId, dwThrdParam = 1; threadHandle = CreateThread( NULL, 0, SimpleThread::ThreadFunc, dwThrdParam, 0, &dwThreadId); } When call the thread it does't get called. Also somtimes it called but the while loop terminate within a while.Can any give me solution to this
AFAIK, we cannot use a normal member function of a class as a thread. there is a different procedure for this, let me remember. but as a temporary solution, i can suggest you to use ThreadFunc as a global function and see. good luck.
-------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.