Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Layout crash during load. (2.9.2) Collapse All
Subject Author Date
Darlene Gariepy Dec 2, 2014 - 3:12 PM

If an application has fewer control bars when its layout was loaded than it did when the layout was saved, it will crash.


One of our applications has a few control bars that get dynamically created after the program has started. The following workflow will cause the Prof library to crash:



  • - Launch the application

  • - Create the dynamic control bars

  • - Save the layout

  • - Close and re-launch the application

  • - Load the layout


 


The crash is caused because the layout contains information on control bars that do not exist when the layout is being loaded. The following patch will fix the crash:


 



 *** E:/2.9.2/Src/ExtControlBar.cpp    Fri Nov 07 11:25:58 2014
--- E:/2.9.2/Src/ExtControlBar_old.cpp    Wed Oct 15 14:48:42 2014
***************
*** 4263,4277 ****
          for( i = 0; i < nCount; i++ )
          {
              InternalDockStateBar * pState =
                  m_arrBarStates[i];
              ASSERT_VALID( pState );
- 
-			 //Don’t try to load the state if this control bar does not exist.
-			 if (m_pDockSite->GetControlBar(pState->m_nBarID) == NULL)
-				 continue;
- 
              pState->PostSyncAttributes( m_pDockSite, NULL );
              if( pState->m_dwDockStateFlags & InternalDockStateBar::__STATE_FLOATING )
              {
                  ASSERT_VALID( pState->m_pHelperBar );
                  CExtMiniDockFrameWnd * pMiniFrame = STATIC_DOWNCAST( CExtMiniDockFrameWnd, pState->m_pHelperBar->GetParentFrame() );
--- 4263,4272 ----
***************
*** 5524,5549 ****
              CExtDynTabControlBar * pTabbedBar =
                  STATIC_DOWNCAST(
                      CExtDynTabControlBar,
                      m_pHelperBar
                      );
- 
-		   const LONG itemCount = pTabbedBar->GetSwitcherItemCount();
-		   if (m_nHelperAciveTabChildIndex < itemCount)
-		   {
            	 LONG nSel = 
                	 pTabbedBar->GetSwitcherSelection();
            	 if(        nSel != m_nHelperAciveTabChildIndex
                	 &&    m_nHelperAciveTabChildIndex >= 0
                	 &&    pTabbedBar->GetBarAt(m_nHelperAciveTabChildIndex,true)->IsVisible()
                	 )
                	 pTabbedBar->SetSwitcherSelection(
                    	 m_nHelperAciveTabChildIndex,
                    	 true,
                    	 true
                    	 );
				 }
-		   }
          }
      
  #ifdef _DEBUG
          INT nChildsCount = (INT)m_arrChildStates.GetSize();
          INT nRealDockedCount =
--- 5519,5539 ----

Art Wilkes Jul 16, 2015 - 10:35 PM

The fix for this is listed above.
Prof-UIS Support