I have something likeclass Window : public Objectclass Control : public Windowclass Container : public Objectclass Panel : public Control, public Containerclass Dialog : public Window, public ContainerPanel::Panel(Container *Parent, int Name) : Control(Parent, Name) { }Control::Control(Container *Parent, int Name) : Window(Parent, GetDlgItem(GetWindow(((Window *) Parent)->hWnd, GW_OWNER), Name)) { }andpanel = new Panel(this, IDC_STATIC1); // this being a Dialog *The problem is that the compiler casts this to a Container pointer adding an offset to it (due to the multiple inheritance); yet, the (Window *) cast does not subtract the respective offset from the pointer. Is there another way of doing this except using dynamic_cast?