Solved

Subclass CDialog

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

705 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