Solved

Z order for modeless dialog

Posted on 2008-06-10
5
1,092 Views
Last Modified: 2013-12-14
I have a VC 6.0 app.  I am launching a modeless dialog from a modal dialog.  But the modeless dialog ALWAYS remains on top of the modal dialog.  So, while I can access the modal dialog underneath, it never gets above the modeless dialog in the Z order.

Your help is greatly appreciated.
0
Comment
Question by:clintonJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 21756619
could you post the code where you create the dialog?  how are you declaring the parent of this dialog?
0
 

Author Comment

by:clintonJ
ID: 21758888
The MODAL parent dialog is launched from another dialog. The parent is created as follows:

CParentDialog dlgParent;
dlgParent.DoModal();

The MODELESS child dialog is created as follows:

In the parent dialog's header file, I declare a pointer to the modeless child, like this:

CChildDialog* m_pChildDialog;

Then, in the parent dialog class, I have a button click message handler to create the child dialog.  I n that message handler, I have the following:

m_pChildDialog = new CChildDialog(this);


Finally, in the child dialog's constructor, I have this code, to create and show the child dialog:

if (Create(CCptDialog::IDD, pParent))  
{      
      ShowWindow(SW_SHOW);      
}


0
 
LVL 19

Expert Comment

by:alb66
ID: 21758984
Is the modal dialog the main application window? If not, pass the main application window as parent:

m_pChildDialog = new CChildDialog(AfxGetMainWindow());
0
 
LVL 19

Accepted Solution

by:
alb66 earned 500 total points
ID: 21758996
Sorry, I didn't read your last comment very well...

You can try this:

m_pChildDialog = new CChildDialog( GetParent() );
0
 

Author Closing Comment

by:clintonJ
ID: 31465919
Works Perfectly!!!!  Thanks a bunch.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
In this post we will learn different types of Android Layout and some basics of an Android App.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question