Solved

Subclassing a dialog class

Posted on 2001-06-20
2
261 Views
Last Modified: 2013-11-20
Can you subclass a dialog?  I am thinking something along the lines of just adding a constructor to my dialog class that allows the IDD to be passed in, so you can basically run the same dialog with additional functionality and a different GUI on it.

Or it could have the additional functionality inside the original dialog, and just do the construction with the different IDD.  No subclass, just allowing a different GUI.

Any reasons why not to do something like this?
0
Comment
Question by:appleby
2 Comments
 
LVL 30

Accepted Solution

by:
Axter earned 100 total points
ID: 6212601
There should be no problem with doing this.

The only thing you have to look out for is to make sure you use the proper constructor, and that your child class sets up that constructor correctly.

Example:
//header *.h file
class xxCDialog : public CDialog
{
public:
     xxCDialog(UINT nIDTemplate, CWnd* pParent = NULL):CDialog(nIDTemplate,pParent){};
};

//*.cpp file
xCDialog::xCDialog(UINT nIDTemplate, CWnd* pParent)
: xxCDialog(nIDTemplate, pParent)
{
}
0
 

Author Comment

by:appleby
ID: 6214319
Great, that's just what I'd intended.  Thanks!!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now