I have something like class Window : public Object class Control : public Window class Container : public Object class Panel : public Control, public Container class Dialog : public Window, public Container Panel::Panel(Container *Parent, int Name) : Control(Parent, Name) { } Control::Control(Container *Parent, int Name) : Window(Parent, GetDlgItem(GetWindow(((Window *) Parent)->hWnd, GW_OWNER), Name)) { } and panel = 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?