L
lothar.behrens
Hi,
I have a base class and virtually derived from them in two other
classes.
In turn I defined a class that derives from the two other class.
Window < MasterWindow <
< DetailWindow < \
MasterDetailWindow (MI_Derived)
In another class - a control, I cannot any more cast to the derived
class.
void LB_STDCALL lbOwnerDrawControl::init(lb_I_Window* parent) {
lbDatabaseDialog* p = (lbDatabaseDialog*) parent;
Create(p, -1, wxPoint(), wxSize(40,40));
}
The help from my compiler describes the error:
'Since the relative position of a virtual base can change through
repeated derivations, this conversion is very dangerous. All C++
translators must report an error for this type of conversion.'
I thought, I extend my base class (database dialog) with a master
detail
functionality trough MI interfaces. But it seems the wrong way.
How can I extend a base class, that may also be a 'master form' or a
'detail form' or even both ?
Takes it sense or should I simply derive a MasterDetailDialog from
DatabaseDialog, because it may be both (master -> detail -> subdetail).
Hope this is not the wrong place for this question.
There may be a pattern for it.
Lothar
I have a base class and virtually derived from them in two other
classes.
In turn I defined a class that derives from the two other class.
Window < MasterWindow <
< DetailWindow < \
MasterDetailWindow (MI_Derived)
In another class - a control, I cannot any more cast to the derived
class.
void LB_STDCALL lbOwnerDrawControl::init(lb_I_Window* parent) {
lbDatabaseDialog* p = (lbDatabaseDialog*) parent;
Create(p, -1, wxPoint(), wxSize(40,40));
}
The help from my compiler describes the error:
'Since the relative position of a virtual base can change through
repeated derivations, this conversion is very dangerous. All C++
translators must report an error for this type of conversion.'
I thought, I extend my base class (database dialog) with a master
detail
functionality trough MI interfaces. But it seems the wrong way.
How can I extend a base class, that may also be a 'master form' or a
'detail form' or even both ?
Takes it sense or should I simply derive a MasterDetailDialog from
DatabaseDialog, because it may be both (master -> detail -> subdetail).
Hope this is not the wrong place for this question.
There may be a pattern for it.
Lothar