Solved

Inheritance and message maps/data exchanges

Posted on 2009-06-29
2
308 Views
Last Modified: 2013-12-14
Hello,

I'm writing an MFC app. There are many "add" and "edit" dialogs for various record types, with a lot of redundant repetition - obvious candidates for refactoring so that each inherits from a common base class.

I have concerns about mixing inheritance with MFC's message/command routing. I seemingly cannot put a messagemap or data exchange in my base class.

Must I maintain mappings and data exchanges in my derived classes? It would be convenient to push that up into the base class.

Regards,
Sternocera
0
Comment
Question by:sternocera
2 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 500 total points
ID: 24737444
Hi sternocera,

IMO there shouldn't be a problem using message maps/data exchange with base- and derived dialog classes. This method is even used in MFC, i.e. CFileDialog is derived from CCommonDialog which is derived from CDialog - all of them have their own message map.

You have to take care that in derived dialog classes you call the correct base-class functions. And it maybe that class-wizard doesn't support to add message handlers/variables as used with CDialog derived classes, so maybe you have to add them manually.

Hope that helps,

ZOPPO
0
 

Author Comment

by:sternocera
ID: 24738079
Zoppo,

I see. Thanks for that,

Regards,
Sternocera
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ffmpeg - "rtsp://...... Operation not permitted" 4 74
zeroFront challenge 7 80
Insert several multiple frames into a single mainframe 3 57
Problem to event 3 78
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
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 tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

920 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

13 Experts available now in Live!

Get 1:1 Help Now