Print Page | Close Window

BUG Crash in ClosePane

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=18802
Printed Date: 30 January 2025 at 9:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: BUG Crash in ClosePane
Posted By: MacW
Subject: BUG Crash in ClosePane
Date Posted: 08 August 2011 at 2:02pm
XTP 15.02 with Visual Studio 2010 on W7

I have a reproducible bug when calling

CXTPDockingPane* ppane = m_paneManager.FindPane(ID);
if (ppane) {
   if (ppane->IsClosed()) {
       ppane->SetEnabled(xtpPaneEnabled);
       m_paneManager.ShowPane(ppane);
   }
   else {
       ppane->SetEnabled(xtpPaneDisabled);
       m_paneManager.ClosePane(ppane);
   }
}

XTP crashes in NotifyAction()

void CXTPDockingPaneAutoHidePanel::CloseActiveWindow(BOOL bDelayed)
{
    if (!m_bCloseActiveWindow)
        return;

    if (m_pActiveWnd)
    {
        if (m_pActiveWnd->m_pPane)
        {

//
BUG m_pActiveWnd->m_pPane->GetSelected() is NULL

            if (GetDockingPaneManager()->NotifyAction(xtpPaneActionCollapsing, m_pActiveWnd->m_pPane->GetSelected()))
                return;

            GetDockingPaneManager()->NotifyAction(xtpPaneActionCollapsed,
                m_pActiveWnd->m_pPane->GetSelected());
        }

If the pane I'm trying to close is an autohide panel (IsHidden() returns true) and the pane is currently visible (opened but in auto-hide mode).







Replies:
Posted By: Oleg
Date Posted: 09 August 2011 at 7:07am
Thanks, fixed.

btw, maybe you need xtpPaneEnableActions instead of xtpPaneDisabled to disable client part only but not all actions...


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: MacW
Date Posted: 09 August 2011 at 9:06am
I, Oleg

thanks. Can I make a work-around in your code so it works here till your next update?

You Wrote:

maybe you need xtpPaneEnableActions instead of xtpPaneDisabled to disable client part only but not all actions...

Thanks. I will look into this.

My code just wants to implement a method for the user to open/close panes via the keyboard. If a pane is a auto-hide pane I want to close it when it is not visible (collapsed) and hide it when it is visible.
Closing/Showing normal panes that way works, but not for auto-hide panes.



Posted By: Oleg
Date Posted: 10 August 2011 at 4:11am
Hi,

Problem can be reproduced only if you set xtpPaneDisabled   - without it it won't crush. So most easy workaround here to not set xtpPaneDisabled  before Close.




-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: MacW
Date Posted: 10 August 2011 at 8:44am
Ah, very well. Will do. Thanks!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net