If you want to remove customization altogether, you should check out the article Prof-UIS Customization Subsystem, and there you can see the code needed to integrate customization into your application. Basically, if your application has customization integrated already, you need to remove all lines showed in that article, that has anything to do with customization. They are as follows:
------ begin quote from article -------
The default menu in case of the MDI application or only one menu in case of the SDI application is registered:
VERIFY(CExtCustomizeSite::MenuInfoAdd(this, _T("Default"),IDR_MAINFRAME,true));
VERIFY(CExtCustomizeSite::MenuInfoLoadAccelTable(_T("Default"),IDR_MAINFRAME));
All documents of the MDI application are registered:
VERIFY(CExtCustomizeSite::MenuInfoAdd(this, _T("Document"),IDR_DOC_TYPE, true));
VERIFY(CExtCustomizeSite::MenuInfoLoadAccelTable(_T("Document"),IDR_MAINFRAME or IDR_DOC_TYPE_ACCEL_TABLE));
The necessary settings can be made for command trees and menus. At this step, the developer can change the structure of any tree, register some text/combobox fields or color commands, modify keyboard accelerator tables, and etc. For example, to reinitialize a registered menu and set its initial state, you should do the following:
CExtCustomizeCmdTreeNode * pMenuNodeInitial = CExtCustomizeSite::MenuInfoGetByName( _T("Default") ) ->GetNode( true );
CExtCustomizeCmdTreeNode * pMenuNodeCustomized = CExtCustomizeSite::MenuInfoGetByName( _T("Default") ) ->GetNode( false );
// reset initially customized menu state:
*pMenuNodeCustomized = *pMenuNodeInitial;
Customize Site is initialized with data associated with this frame window. The necessary commands are registered in it:
if(!CExtCustomizeSite::EnableCustomization(this, __ECSF_DEFAULT))
{
ASSERT( FALSE );
return -1;
}
CExtCustomizeSite::CategoryUpdate( IDR_MAINFRAME ); CExtCustomizeSite::CategoryMakeAllCmdsUnique();
CExtCustomizeSite::CategoryAppendAllCommands(); CExtCustomizeSite::CategoryAppendNewMenu();
Persistent states of the customization subsystem and control bars are restored. Typically, these operations are final in the OnCreate() method of the frame window:
CExtCustomizeSite::CustomizeStateLoad(pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName );
Finally, you should put the code for storing the UI state into the DestroyWindow() method of the main frame window:
BOOL CMainFrame::DestroyWindow()
{
...
VERIFY(CExtCustomizeSite::CustomizeStateSave(pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName));
...
}
---------- end quote from article ----------
And finally one more thing, which I didn’t find in that article: In MainFrm.h, instead of
class CMainFrame : public CExtNCW < CFrameWnd >
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
, public CExtCustomizeSite
#endif // (!defined __EXT_MFC_NO_CUSTOMIZE)
your MainFrame shouldn’t be derived from CExtCustomizeSite, and should look like this:
class CMainFrame : public CExtNCW < CFrameWnd >
Hope that helps and everything is clear.
Chris