Can't catch OnClose() in CSocket
-
Hi! Please, help me to resolve a simple problem. I can't catch OnClose() notification in the CSocket-derived class. What's wrong? However, OnSend() and OnReceive() work fine. Maybe, Does anybody know useful trick? ///////////////////////////////////////////////////////////////////////////// // CNetClientSock command target class CNetClientSock : public CSocket { // Attributes public: // Operations public: CNetClientSock(); virtual ~CNetClientSock(); // Overrides public: CWinThread* m_pThread; // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CNetClientSock) public: virtual void OnClose(int nErrorCode); virtual void OnSend(int nErrorCode); virtual void OnReceive(int nErrorCode); //}}AFX_VIRTUAL // Generated message map functions //{{AFX_MSG(CNetClientSock) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG // Implementation protected: }; void CNetClientSock::OnClose(int nErrorCode) { // TODO: Add your specialized code here and/or call the base class m_pThread->PostThreadMessage(WM_QUIT,0,0); CSocket::OnClose(nErrorCode); } Yours sincerely, Alex Bash