REPOST: Modal dialog doesn't disable modeless dialog when running

REPOST: Modal dialog doesn't disable modeless dialog when running

Post by Thomas Pag » Thu, 08 May 2003 17:37:19



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?

 
 
 

REPOST: Modal dialog doesn't disable modeless dialog when running

Post by Duke S » Fri, 09 May 2003 16:44:30


Could you provide a sample to reproduce the issue?

 
 
 

REPOST: Modal dialog doesn't disable modeless dialog when running

Post by Duke S » Thu, 15 May 2003 22:03:44


I got it. I will update you as soon as possible.

Best regards,
quansun
VS.NET, Visual C++
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net?  http://www.gotdotnet.com

 
 
 

REPOST: Modal dialog doesn't disable modeless dialog when running

Post by Thomas Pag » Tue, 20 May 2003 17:39:51


Thank you for your help!
Best regards, Thomas Pagh


Quote:> You create a modaless dialog first, and then you create a modal dialog.

> Both the modaless and the modal dialog are created to your server process.
> However, you container window exists in another process, the container
> process.

> When you call DoModal() for the modal dialog, the container frame window
is
> disabled.

> However, because the modaless dialog belongs and its messages are handled
> by the server process, it can response to the keyboard/mouse messages as
> usual.

> That's the cause of the issue and it should be by design. You can trace
> into MFC source code for more details.

> Workaround
> ============
> You should syncronize the windows of the server process by yourself. I
> modified your sample. Now it works fine. Please refer to the attachment.

> Best regards,
> quansun
> VS.NET, Visual C++
> Microsoft

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Got .Net?  http://www.gotdotnet.com

 
 
 

1. Modal dialog doesn't disable modeless dialog when running InPlace.

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?

2. HELP!!! How to load Tiff image with ISO-JPEG compressing to .NET Bitmap class

3. Modal dialog as the parent of a modeless dialog...

4. Looking for beta testers for internet utilities software

5. Can we change the Modal Dialog to Modeless dialog ???

6. Indigo Color Output

7. Modeless dialog out of a Modal dialog box: possible?

8. Correction - FS:A500/Mousestick, HD

9. Modeless dialog inside modal dialog

10. Calling a modeless dialog box from a modal dialog box

11. Showing modeless dialog from modal dialog

12. Help! Modal dialog opening modal dialog = problem

13. Modeless Dialog in another modeless Dialog