![]() |
Hide and Select Pane Crashes |
Post Reply ![]() |
Author | |
Sorcerysoft ![]() Newbie ![]() ![]() Joined: 29 October 2004 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() Posted: 29 October 2004 at 3:03pm |
The code below causes our application to crash. I've tried a few variations of the code such as hiding and showing the pane by calling CXTPDockingPaneManager::HidePane() and CXTPDockingPaneManager::ShowPane(). Can someone help me resolve this problem? Thanks. ---CODE------------------------------------ LRESULT CCustomJobFrame::OnToggleViewCustomJobItems( WPARAM wParam, LPARAM lParam ) if( pDockingPane != NULL ) ---CALLSTACK--------------------------------- CWnd::Invalidate(int 0) line 126 + 43 bytes void CXTPDockingPaneAutoHidePanel::ShowPane(CXTPDockingPane* pPane, BOOL bSetFocus) |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Thought 1. may be you forget to call paneManager.InstallDockingPanes(this); in OnCreate()
Thought 2. m_hWnd of CXTPDockingPaneAutoHidePanel is null only if you call OnToggleViewCustomJobItems before any WM_SIZE event of CCustomJobFrame. (f.e. in OnCreate method) if so call RecalcLayout before you call OnToggleViewCustomJobItems. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Sorcerysoft ![]() Newbie ![]() ![]() Joined: 29 October 2004 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
Thought 1 isnt possible because the panes are created and visible. Thought 2 worked. Thanks. LRESULT CCustomJobFrame::OnToggleViewCustomJobItems( WPARAM wParam, LPARAM lParam ) CXTPDockingPane *pDockingPane = m_paneManager.FindPane( IDR_JOBITEM ); if( pDockingPane != NULL ) Edited by Sorcerysoft |
|
![]() |
|
spike ![]() Groupie ![]() Joined: 13 May 2003 Location: United States Status: Offline Points: 48 |
![]() ![]() ![]() ![]() ![]() |
Oleg, FYI, There is a bug in DockPane() internally it calls GetPaneDirection which always returns DockLeftOf. The only way we found to restore a panes "dock position" was to call ShowPane then DockPane (which flickers the pane in the rect you specify before docking it in its previous state). |
|
![]() |
|
Sorcerysoft ![]() Newbie ![]() ![]() Joined: 29 October 2004 Location: United States Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
This was our work-around for the GetPaneDirection() problem: LRESULT CCustomJobFrame::OnToggleViewCustomJobItems( WPARAM wParam, LPARAM lParam )
Edited by Sorcerysoft |
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
my suggestion is to move RecalcLayout before first call of OnToogleCustomJobItem of OnCreate method and call m_paneManager.SyncPanesState() after RecalcLayout. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
viktor ![]() Newbie ![]() Joined: 03 August 2007 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
I have encountered similar problem, however with different conditions.
// Select panes
for( int i = nPaneCount - 1; i >= 0; i-- )
{
CXTPDockingPane* pPane = pDockManager->FindPane( sPane.nID );
BOOL bShowRight = this->CheckShowPaneRight( sPanes.nID );
if( sPanes.bShowPane && bShowRight )
{
if( pPane )
pDockManager->ShowPane( pPane );
}
else
{
if( bShowRight )
{
if( pPane )
pDockManager->HidePane( pPane );
}
else
{
if( pPane )
pDockManager->ClosePane( pPane );
} // else
} // else
pDockManager->RecalcFramesLayout();
}
I need to call RecalcFramesLayout inside the cycle, put it ahead of it does not help.
If I dont recalculate frames, Invalidate method in AutoHidePanel also fails, however hWnd of AutoHidePanel is not NULL, it's got a value, however ASSERT( ::IsWindow( hWnd ) ) in CWnd::Invalidate fails.
If all panes are set to ShowPane, this does not happen.
InstallDockingPanes is certainly called and the code above is called after OnCreate
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
try to call RecalcLayout(); before this cycle.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
viktor ![]() Newbie ![]() Joined: 03 August 2007 Status: Offline Points: 2 |
![]() ![]() ![]() ![]() ![]() |
I tried CFrameWnd::RecalcLayout, however does not help.
Still crashes.
|
|
![]() |
|
Oleg ![]() Senior Member ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
I need some sample to trace in my side. Maybe you can try modify our samples with your code ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |