Posted on 2003-03-23
I'm trying to create a socket class with MSVC++ 6 that allows a simply handling of network connections. To make connections asynchron I use the select() function to get readable/writable-signals for a socket. For each signal, my application has to create a thread that calls a member function to handle that signal, i.e. to recv() or send() on that socket.I call CreateThread() to open a new thread:
CreateThread(NULL, 0, this->onRecv, (void *)0, 0, &thread)
where the socket class' member function "onRecv" looks as following:
unsigned long WINAPI onRecv(void *);
The compiler gives the error C2440, which says:
"Unable to convert argument 3 from 'unsigned long (void *)' to 'unsigned long (__stdcall *)(void *)'"
Somebody out there with some experience or any help ?