views:

40

answers:

1

I'm working in an MDI application that has a pointer to a document's frame object. Other threads are calling PostMessage using the pointer. During shutdown, the threads continue trying to post messages to the frame while the frame is being destructed. Does anyone know the destruction order of the multiple documents in MFC's MDI implementation? Is there a message that I should be handling that would make this easier (Maybe the Frame's ON_WM_CLOSE)?

A: 

If your threads are posting messages only to frame object you could notify these threads about frame's destruction by using CEvent in frame's WM_CLOSE handler. In that case I don't see why do you need to know destruction order?

Kirill V. Lyadvinsky
I used the frame's ON_WM_DESTROY() to shutdown the threads.
Kieveli