Your question, your audience. Choose who sees your identity—and your question—with question security.
//== Start Thread ==//
void CSocketClass::StartThread()
{
DWORD threadID;
for(int n=0;n<THREADCOUNT;n++)
{
g_hThread[n]=(HANDLE)CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ProcessThread,NULL,NULL,&threadID);
}
}
(LPTHREAD_START_ROUTINE)Prnormally it is not so good an idea to cast the thread function. it is much better to use a thread function which already has the correct signature and therefore could be used without cast.ocessThrea d
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Hard to say what's going on there. do you think you could a.) post the declaration of ProcessThread and b.) check the return value GetLastError by adding something like this directly after the line 8 which calls CreateThread:
TRACE( "CreateThread returned 0x%x, last error is %d\n", g_hThread[n], GetLastError() );
ZOPPO