Thank you for a revision.
I am saved.
By the way,
Does not MenuRebuild have any problem in following program-code?
void MenuRebuild( CExtRibbonNode * pRibbonNode )
{
CMemFile _file;
CArchive arSave( &_file, CArchive::store );
MenuInfoGetDefault()->AccelTableSerialize( arSave );
arSave.Close();
//
//
// PROF-UIS TECH SUPPORT
// The folloiwing code snippet fixes the assertion problem.
// You are reinitializing the ribbon bar control using
// the same command tree as was used in it before.
// But after the quick access toolbar customization, this command tree
// contains some temporarily command nodes.
// So, such command tree should not be assigned to the ribbon bar again.
// The code snippet below just cleans temporarily command nodes.
//
//
//CExtRibbonNodeQuickAccessButtonsCollection * pNodeColQATB = Ribbon_GetQuickAccessRootNode();
//INT nIndex, nCount = pNodeColQATB->GetNodeCount();
//for( nIndex = 0; nIndex < nCount; )
//{
// CExtCustomizeCmdTreeNode * pNode = pNodeColQATB->ElementAt( nIndex );
// if( pNode == NULL )
// {
// nIndex ++;
// continue;
// }
// ASSERT_VALID( pNode );
// if( (pNode->GetFlags()&__ECTN_RIBBON_QA_CLONED_COPY) != 0 )
// {
// pNode->RemoveSelf( NULL );
// nCount --;
// continue;
// }
// else
// {
// pNode->ModifyFlags( 0, __ECTN_TBB_HIDDEN );
// nIndex ++;
// continue;
// }
//} // for( nIndex = 0; nIndex < nCount; )
SetButtons( NULL );
SetButtons( pRibbonNode );
_file.Seek( 0, CFile::begin );
CArchive arLoad( &_file, CArchive::load );
MenuInfoGetDefault()->AccelTableSerialize( arLoad );
arLoad.Close();
_RecalcPositionsImpl();
CMDIFrameWnd * pFrame = (CMDIFrameWnd *)AfxGetMainWnd();
OnUpdateCmdUI( pFrame , TRUE );
//
// PROF-UIS TECH SUPPORT
// We are sorry, we forgot to invoke the following line of code
// which updates in-MFC accelerator tables:
//
OnUpdateAccelGlobalInfo( true );
RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_ALLCHILDREN );
CExtPaintManager::stat_PassPaintMessages();
};
};