Re: MFC and User Defined objects
This would work OK for a dialog, but in other kinds of doc/view applications
this would be problematic of course. Of course, you could have the
mainframe handle the message even if it were not the final recipient. There
should always be at least the frame window while the program is running.
This has been an interesting discussion.
Tom
"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:12ve7k03unjc1eb@news.supernews.com...
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:ON$ubCaZHHA.4692@TK2MSFTNGP04.phx.gbl...
Your object in a worker thread needs to be passed a CWnd* or HWND for the
main window. This can be passed into to the thread function via the
thread parameter.
Then you can use pwnd->PostMessage or ::PostMessage(hwnd,..) from your
object. Example here...
http://vcfaq.mvps.org/mfc/12.htm
Yes, except since it's the main dialog/window that is always being posted
to, the worker thread can just call AfxGetMainWnd() instead of being
passed it.
-- David