Hello, I have an object called XXX previously derived from CDocument in
my MDI project.
Later, I create an concrete class called Subject. And I let XXX to have
multiple inheritance from Subject (Subject is an object with protected
constructor)
The problem is, whenever I used dynamic_cast to cast a Subject pointer
to XXX (I am quite sure Subject pointer is actually pointing to XXX), a
visual c++ runtime error will occur.
void fun(Subject *s) {
XXX *var = dynamic_cast(s);
var->hehehe();
}
However, when I try to do this:
void fun(Subject *s) {
XXX *var = (XXX *)(s);
var->hehehe();
}
everything just go fine. may i noe why this happen? is this bug related
to something called dynamic creation?
thanks you.
cheok