Solved

Subclass CDialog

Posted on 1998-01-07
2
608 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
[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 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

707 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