views:

63

answers:

0

I am making a project in VC++ using mfc. I'm connecting to a server, sending a notification message like "user blabla" and start awaiting messages from that server. The server receives the initial message and responds with a message but the onReceive method isn't called on the client. The client is receiving the message because when I call mySocket.Receive(...) I can see the message. I can't just call .Receive() in a loop because it's an asyncronous application.

class mySocket:public CAsyncSocket{
      void onReceive(int nError){
        AfxMessageBox("received message");
      }

};


void CPOODlg::OnBnClickedButton7() 
    {
  char * ddd="user 0234234234";
  mySocketInstance.Send(ddd,15);
    }

MY BAD, it was "OnReceive" not "onReceive" !! now it works fine