class TestOne class TestTwo : public TestOne class TestCore : public TestTwo class TestElement class TestMainObject : public TestElement, TestCore TestElement *pObj = (a TestMainObject but as TestElement); TestOne *pThisIsNull = dynamic_cast(pObj);