CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    1

    About CAsynSocket

    hi All?

    I design a 'CPopSocket' class derived form CAsynSocket. I make following code .


    CPopSocket * m_pPopSocket = new CPopSocket;
    m_pPopSocket->Create();
    ... ( some POP3 operation )

    m_pPopSocket->AsyncSelect(0);
    delete m_pPopSocket;

    After deleting m_pPopSocket, I find that there is FD_READ message in message queue sometimes ( 1%).
    because m_pPopSocket has been destory. program display a Error Message.
    I .don't kown Where Error is in .

    any halp need !


  2. #2
    Join Date
    Apr 1999
    Posts
    43

    Re: About CAsynSocket

    Try clearing the message queue first. Use PeekMessage() to see if there are any messages, then use GetMessage() to remove it from the queue and DispatchMessage() to dispatch the message. When all requests have been handled, you can destroy the object. If you don't want the message to be handled you retreive the message ID from GetMessage() and skip that message.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured