[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Modeless Dialog

Posted on 1998-03-04
3
Medium Priority
?
396 Views
Last Modified: 2013-11-20
I would like to ask how can I display a modeless dialog box.
Actually I created the modeless dialog using CDialog::Create.. After creating , the dialog box is not displayed.. Then I try to use ShowWindow() after the creation but the dialog box is still not displayed
0
Comment
Question by:Yinteo
[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
3 Comments
 

Accepted Solution

by:
VexPI earned 100 total points
ID: 1316749
If you have Visual C++ 5.0 check on the CD in the /Samples/General/Modeless directory for a sample of a modeless dialog.

I believe you do a DialogName.DoModal();  even though the dialog should be modeless.

Check the samples!

Try DoModal(), too.
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1316750
  Code like this has always worked for my non-modal dialog boxes:

/**/    CMyDialog::CMyDialog( CWnd *pParent ) :
            CDialog( IDD, pParent )
{
    Create( IDD, pParent );
    ShowWindow( SW_SHOW );

    return;
}

   If you have something like that, and it is not working, make sure that your dialog template (and all of its controls ) is/are loading correctly.

-=- James.
0
 

Expert Comment

by:vhegde
ID: 1316751
Here is what you need to do. Shown below is the code in the
dialog constructor

CModeLessDlg::CModeLessDlg(CWnd* pParent /*=NULL*/)
      : CDialog(CModeLessDlg::IDD, pParent)
{
      //{{AFX_DATA_INIT(CModeLessDlg)
            // NOTE: the ClassWizard will add member initialization here
      //}}AFX_DATA_INIT
      Create(CModeLessDlg::IDD,pParent);
}

Below is the code to create the dialog box (in view for example)

void CWebClientView::OnModelessDialog()
{
      // TODO: Add your command handler code here
      if(pDlg==NULL)   //pDlg is a Dialog pointer in view.h
      {
       pDlg=new CModeLessDlg(this);
       pDlg->ShowWindow(SW_SHOW);
      }

      
}

You can avoid calling ShowWindow if you set the the properties
of the dialog template properly. In particular, set the visible
property to true under "more styles"






0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

656 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