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
Solved

Subclass CDialog

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 108
Get filename and folder into excel 7 79
sameEnds challenge 3 180
ffmpeg - "rtsp://...... Operation not permitted" 4 86
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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.

856 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