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

x
?
Solved

modeless dialogs

Posted on 1998-12-04
2
Medium Priority
?
228 Views
Last Modified: 2013-11-20
hi regards!
i already asked this question, but i didn't get convincing reply. Please do explain modeless dialog, the arguments
passed to it's create member function. Please cite an
example. Is it a must to allocate dynamically the memmory for modeless dialogs ? ..................
0
Comment
Question by:sunraj
[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 4

Accepted Solution

by:
pagladasu earned 100 total points
ID: 1325777
The no arguments passed into the Create() function of a modeless dialog box are two. The first one is an unsigned integer, representing the ID value of the dialog box. The second argument is a pointer to the parent window.
Here is an example which displays a modeless dialog box:

CMyDiaog *m_pdlg=new CMyDialog;
m_pdlg->Create(IDD_MYDIALOG,this);

When you are using the Create method, it is recommended to create it on the heap. However, using other methods, you can still create modeless dialog boxes without using a pointer.
Thanks
pagladasu.
0
 

Expert Comment

by:ramrocket
ID: 1325778
You must also override CDialog::PostNcDestroy()

void CMyDialog::PostNcDestroy()
{
  delete this;
}

so you dont need to explicitly delete m_pdlg
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…

661 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