Winsock asynchronous socket + MessageBox() = trouble?
Hey, I've been writing a little chat server and I needed to do asynchronous sockets for it. So I set up the socket, binded it to the port and listened, then I passed the WSAAsyncSelect() function. Now, here is what my message-handler function looks like:
Now, I run the program and I CAN connect to it, so I know that it's working, however you see where I called the MessageBox function above, those never show up. I don't have a clue as to why it wouldn't execute that function or block it from showing up at all. Hmm... Any help is appreciated.
LRESULT CALLBACK WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
case WM_SOCKETMESSAGE: //my defined message(WM_USER+1)
MessageBox(hwnd,"Connection established!","Incoming Connection",MB_OK);
MessageBox(hwnd,buffer,"New Data Received",0);