I have written an MFC application that needs to receive data from a telnet port. I had previously placed recv calls in an endless loop in a global function. It worked, but hogged CPU time. I am now trying to get the same service working using WSAAsyncSelect( ). I am calling the function from my CMainFrame::OnCreate but am not seeing my message being passed to the appropriate message handler
(ie. the message handler:
void CMainFrame::OnServerMessageWaiting(WPARAM wParam, LPARAM lParam)
is never called). I think it is because I am not using the correct value for the second argument of WSAAsyncSelect( )
// Turn on Windows Message Notification of socket events
m_hWnd, // <- WHAT SHOULD THIS BE?
(FD_READ | FD_CLOSE));
Or maybe I am doing something else wrong.