PDA

Click to See Complete Forum and Search --> : CreateThread compile error


Cmdr0Sunburn
Jan 7th, 2003, 07:32 PM
hi when i use
CreateThread(0,0, Client, 0, 0,&lpThreadID3);
on

DWORD WINAPI Client(void)
{

theClient = accept(hSocket,NULL,NULL);
if (theClient == INVALID_SOCKET) {
printf("Error at accept()");
WSACleanup();
return 0;
}


}


i get this error in msvc++, im even following an example from msdn. can you help me?

F:\C++\newprojects\Winsck\Server\Servermain.cpp(62) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'unsigned long (void)' to 'unsigned long (__stdcall *)(void *)'
None of the functions with this name in scope match the target type.

CornedBee
Jan 8th, 2003, 03:43 AM
The thread entry point needs a void * parameter.