I have a modeless dialog running, when I call DoModal on
another modal dialog. Under normal circumstances the
modeless dialog will be inaccessible until the modal
dialog is ended. But when I run InPlace, the modal dialog
doesn't hinder access to my modeless dialog.
Both dialogs are MFC CDialogs, and the main window of my
application is CFrameWnd when running "standalone", and
COleDocIPFrameWnd when running "inplace".
Apparently MFC's DoModal disables the topmost parent
(first parent without WS_CHILD style) of the modal
dialog. The topmost parent is CFrameWnd of my application
when running "standalone", and it is the main window of
the "hosting application" when running "standalone". So
when running standalone my modeless dialog and its
topmost parent belong to the same thread and process (
MyApplication.exe), while when running inplace, the
modeless dialog (MyApplication.exe) and its topmost
parent (HostApplication.exe) belongs to different threads
and processes. Maybe that's why disabling the main window
of the hosting application doesn't disable my modeless
dialog, although the hosting window is parent (and owner)
of the modeless dialog.
How do I make DoModal behave the same for standalone and
inplace dialogs?