Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Modeless Dialog in MainFrame

Posted on 1999-06-25
2
Medium Priority
?
299 Views
Last Modified: 2013-11-20
I need to make a modeless dialog in the CMainFrame. My application has a MainFrame with no active documents. I,ve tried creating a new dialog class with a custome create function ala programming Visual C++ 5th edition and activateing like so

// create instance
pMyDialog = new MyDialog (this);

// trying to show dialog

if (pMyDialog->GetSafeHwnd () == 0)
  {
  pMyDialog->Create ();  // doesn't work
  }

can anyone help ?
0
Comment
Question by:BlackRussian
[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 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 480 total points
ID: 1308013
After you have created the dialog box, you need to call ShowWindow

// create instance
pMyDialog = new MyDialog (this);

// trying to show dialog

if (pMyDialog->GetSafeHwnd () == 0)
  {
  pMyDialog->Create ();  // doesn't work

if (!pMyDialog->IsWindowVisible ()) {
pMyDialog->ShowWindow (SW_SHOWNORMAL);
}

  }




0
 

Expert Comment

by:sunraj
ID: 1308014
For modeless dialog, when you call Create function, you should pass the ID of the dialog box, otherwise it won't work
 for e.g   pMyDialog->Create(IDD_DIALOG1);
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

704 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