Solved

Subclass CDialog

Posted on 1998-01-07
2
595 Views
Last Modified: 2013-11-20
I'm trying to construct the following Tree

CDialog
 +- CRuleDialog
    +- CRegexpDialog
    +- CCropDialog
    +- ...

The CExtended dialog is a CDialog with some methods and variables that are common to the other classes (CRegexpDialog, CCropDialog...).

I just can't get it right. (Maybe my skills in C++ isn't enough, but that will change this year!)

I would like to have a short sample code to try...
0
Comment
Question by:marre111397
2 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 100 total points
ID: 1313537
if CDialog is base class for CRuleDialog and CRuleDialog is base class for CRegexpDialog, CCropDialog you must do the following.

First create dialog templates for CRegexpDialog, CCropDialog and for CRuleDialog if you want to create instance of this dialog. Then use ClassWizard to create class CRuleDialog as derived class from CDialog. Also use ClassWizard to create classes CRegexpDialog, CCropDialog as derived from CDialog. Now change the constructor of CRuleDialog generated by ClassWizard. Add the second parameter of type UINT which is ID of dialog resource. Also be sure the first parameter of type CWnd* is not default. Also in constructor definition pass CWnd* and UINT parameter to CDialog contructor
CRuleDialog::CRuleDialog(UINT id, CWnd *pParent)
      : CDialog(id, pParent)
{
}

Make the same changes for CRegexpDialog and CCropDialog classes but the base class will be CRuleDialog instead of CDialog.

CRegexpDialog(CCropDialog)::CRegexpDialog(CCropDialog)(UINT id, CWnd *pParent)
      : CRuleDialog(id, pParent)
{
}
0
 

Author Comment

by:marre111397
ID: 1313538
Thanks...
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 67
Error on moodle after upgrade 3 130
ffmpeg - "rtsp://...... Operation not permitted" 4 80
Doc'in system (example?) BA 7 105
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

16 Experts available now in Live!

Get 1:1 Help Now