Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

modeless dialogs

Posted on 1998-12-04
2
Medium Priority
?
230 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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: 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.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

877 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