Inheritence using CDialog/CPropertyPage Based Classes
Posted on 2001-08-30
I need some fairly urgent help with an application I
am doing in VC++ (version 6.0)
The application I am building is an SDI front end
with a pure C++ calculator class behind it.
I am focusing on the Front end at the moment.
My goal is to present to the user a set of property
pages which basically contain a useful interface for
collecting the data to populate the classes inside the
So far this has been going fairly well.
My problem is:
I am trying to use MULTI-LEVEL INHERITANCE to build the
Rather than define a new DIALOG for each sheet, I have
TWO basic dialogs which will be replicated (50+) times.
The Inheritance structure Looks something like this:
Class A : CPropertyPage // My Property Page Base Class
Class B : Class A // My Standard Page Class
Class C : Class A // My Non Standard Page Class
Class D : Class B // Implementation of Stanard Page
Class E : Class C // Implementation of Non Standard Page
In terms of O-O I think it is quite solid, however in
terms of MFC I keep getting REALLY Strange things happening.
First, I thought that I should be able to declare
all of my Dialog Controls and Handlers for them in
Class B for the Standard and Class C for the Non Standard
This is fine, EXCEPT when I get into the implemented
versions of these classes, the messages for the controls
are not reaching the FORMS!!!
That is, the messages are being sent, but not being
A good example is:
In my implementation of Class D, I try and catch the
OnChange Event for an edit control which is on the
Dialog associated with Class B. When the message is
sent, the control which is displayed on the
screen never receives the message.
Anyway, I am in a bit of a rush to get this done,
and I appologise for the LENGTHY question, but
I think I need to be clear about the problem as it
is not straight forward.
Any help would be greatly appreciated.
Please note, I REALLY want to avoid creating a dialog
and/or set of controls+handlers for EACH page (50+)
as this would be EXTREMELY redundant and I could make
much better use of inheritance (I think/Hope)