CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Sending message to CDocument derived class member

    Hi,

    I have a command handler on CDocument derived class. This function creates a thread and terminates. When the thread function reaches a certain point, I would like to post a message so that one of other CDocument member function will be invoked.

    The problem is, CDocument doesn't own a window and therefore I can't call PostMessage. (CDocument doesn't have a member function PostMessage)

    How can I accomplish this?

    Thanks
    Jim



  2. #2
    Join Date
    Sep 1999
    Location
    Pakistan
    Posts
    22

    Re: Sending message to CDocument derived class member

    hello friend,
    theres an easy way, just pass the pointer of the document, as a parameter to the thread function and call its member function when needed.

    Hope it helps,
    Tufail Khan


  3. #3
    Guest

    Re: Sending message to CDocument derived class member

    Thanks for the reply. But I need to post a message instead because if I call the function, the thread will be suspended until the function returns. If I post the message, the function will be invoked asynchronously.

    Thanks



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