?
Solved

Subclass CDialog

Posted on 1998-01-07
2
Medium Priority
?
614 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 300 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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 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