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 General Discussion » crashes if to modify CExtRibbonBar in respond to ribbon galery selection Collapse All
Subject Author Date
Vlad K Jun 21, 2007 - 3:02 PM

I have "floating" crashes in the following scenario:

0)...
1) user selects an item in the ribbon galery’s popup portion;
2) OnRibbonGalleryItemSelEndOK() is invoked. The methos translated gelery item and PostMessages WM_COMMAND to the mainframe;
3) eventually the main frame processes the command modifies the ribbon in the following mode (all the methods are invoked to for the ribbon).
3.1) Ribbon_PageSelectionSet( 3 ); // a suggetion to switch to some page temporart (i found it on the forum)
3.2) p_ribbonnode_old->ModifyFlags( __ECTN_TBB_HIDDEN );
3.3) Ribbon_PageSelectionSet( selected ); // select back to the page
3.4) I also did some "magics" things which i found on the fourm, like
_RecalcPositionsImpl();
GetParent()->CWnd::RepositionBars(0,0xFFFF,0);
Invalidate();
it does not matter, actually.
3.5) return (back to MFC);

then it crashes in different places (-> memory corrupted).

it looks that 3.1) causes the problem because it deleted all the ribbonButtons while the galery is doing its anymation (its fades out).

Can you please help?(i lost too much time trying to find a solution...).
thanks!

Vladimir

Vlad K Jun 22, 2007 - 2:36 PM

PS:
sorry, the "right" edition of the method is
========================
//-----------------------------------------------------------------------------------------------------------------------------------------------
LRESULT CMainFrame::OnMessage1234( WPARAM, LPARAM )
{
m_wndRibbonBar.Ribbon_PageSelectionSet( 1 );
mp_clipboard_node->ModifyFlags( __ECTN_TBB_HIDDEN );
m_wndRibbonBar.Ribbon_PageSelectionSet( 0 );

m_wndRibbonBar._RecalcPositionsImpl();
    m_wndRibbonBar.Invalidate();
    RepositionBars(0,0xFFFF,0);
return 0;
========================
But it does not really matter :)

Vlad K Jun 22, 2007 - 2:30 PM

Hello,

i have made the same scenario in RibbonBarMD...
It still crashed there and i did not touch the ribbon gelry afterwards.
please get the file by http://www.sharebigfile.com/file/188061/ribbon-crash-zip.html
disable all breakpoints and use the galery.
the code crashes from CMainFrame::OnMessage1234().

ZIP contain a screen shot taken at the moment of crash - the galery window is still visible (it needs to do its animation) - that is why i think it has something to do with it.

can you please suggest some workaround.

Vladimir

Technical Support Jun 23, 2007 - 12:40 PM

Thank you for reporting this issue. Here is the compiled version of the project you send us with the latest Prof-UIS binaries. If you have a subscription, please contact us via email so we can provide you with the updated source code.

Technical Support Jun 22, 2007 - 11:57 AM

The ribbon bar’s skeleton is described by command tree nodes which your code creates while initializing the ribbon and CExtRibbonBar is an improved version of the CExtToolControlBar toolbar control. In other words it is based on the same CExtBarButton objects which implement toolbar buttons. These button objects exist only for displayed buttons only. When a new ribbon page is selected, the current set of displayed buttons is destroyed and a new set of buttons is created for the newly selected ribbon page. Please make sure you do not try to access the ribbon gallery after step 3.3. If the problem persists, please send us a test project.