![]() |
error |
Post Reply
|
| Author | |
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Topic: errorPosted: 31 October 2008 at 7:51am |
|
Hello,
i've follow code. CXTPDockingPaneTabbedContainer* pContainer = GetParentContainer(pWnd); if (pContainer && pContainer->GetPanes().GetCount() > 1) { CXTPDockingPane* pSelected = dynamic_cast<CXTPDockingPane*>(pContainer->GetPanes().GetHead()); after dynamic cast i get error Eine Ausnahme (erste Chance) bei 0x10227827 (msvcr71d.dll) in Lasal2.exe: 0xC0000005: Zugriffsverletzung-Leseposition 0x00000004. Eine Ausnahme (erste Chance) bei 0x7c812aeb (kernel32.dll) in Lasal2.exe: Microsoft C++ exception: __non_rtti_object @ 0x0012f20c. Why ? corrupt rtti info ? Jimmy |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 October 2008 at 9:03am |
|
Hi, Show GetParentContainer code.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 October 2008 at 9:16am |
|
Hi Oleg,
CXTPDockingPaneTabbedContainer *GetParentContainer(CWnd* pParentWnd) { if (pParentWnd == NULL || pParentWnd->GetSafeHwnd() == NULL) // no Window attached return NULL; while (pParentWnd != NULL) { CXTPDockingPaneTabbedContainer *pContainer = DYNAMIC_DOWNCAST(CXTPDockingPaneTabbedContainer, pParentWnd); if (pContainer) return pContainer; pParentWnd = pParentWnd->GetParent(); } return NULL; } Jimmy |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 October 2008 at 9:21am |
|
Hi Oleg,
After i add this, it will be work. class CExXTPDockingPane : public CXTPDockingPane { public: CExXTPDockingPane(CXTPDockingPaneLayout* pLayout) : CXTPDockingPane(pLayout) { } }; class CExDockingPaneManager : public CXTPDockingPaneManager { public: CXTPDockingPaneLayout *GetLayoutCurrent() { return m_pLayout; } virtual CXTPDockingPaneBase *OnCreatePane(XTPDockingPaneType type, CXTPDockingPaneLayout* pLayout) { if (type == xtpPaneTypeDockingPane) { return new CExXTPDockingPane(pLayout); } return __super::OnCreatePane(type, pLayout); } }; Jimmy |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 October 2008 at 9:33am |
|
Hi Oleg,
i see rtti is not activated in Tookit DLL. Think, this is the problem. Jimmy |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 October 2008 at 12:49pm |
|
Hi,
You can use C style cast. CXTPDockingPaneTabbedContainer always has only CXTPDockingPane:
CXTPDockingPane* pSelected = (CXTPDockingPane*)pContainer->GetPanes().GetHead());
or if you need selected:
CXTPDockingPane* pSelected = pContainer->GetSelected()
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Posted: 03 November 2008 at 4:25am |
|
Thanks Oleg.
Jimmy |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |