Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

error

 Post Reply Post Reply
Author
Message
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Topic: error
    Posted: 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2008 at 9:03am

Hi,

Show GetParentContainer code.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2008 at 9:33am
Hi Oleg,

i see rtti is not activated in Tookit DLL.
Think, this is the problem.

  Jimmy

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2008 at 4:25am
Thanks Oleg.

  Jimmy

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.