Click to See Complete Forum and Search --> : Sending message to CDocument derived class member


October 13th, 1999, 11:33 AM
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

Tufail Khan
October 13th, 1999, 11:44 AM
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

October 13th, 1999, 12:56 PM
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