Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can't catch OnClose() in CSocket

Can't catch OnClose() in CSocket

Scheduled Pinned Locked Moved C / C++ / MFC
helplinuxquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bash
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups