c++ - CMFCToolBar & CMFCMenuBar don't show dynamic items by default -
I have created an MFC application that uses CMFCToolBar and CMFCMenuBar it saves the status of items for the first time, when I I change or add any moving objects, even then I first see the state that deleted items remain there, where extra items are not shown, then I came to know that all the items are sorted in the registry and every time Loads, in the application In our all applications to load dynamic menu items or toolbar buttons from the module, in fact I could not work except the following solution
class CToolBarEx: public CMFCToolBar {public: CToolBarEx () { } Virtual Bull LoadState (LPCTTR / * Lps Profile Name * / = Null, Int / * NIDEX * / = -1, UINT / * UID * / = (UINT) -1) {Return Incorrect; } Virtual BOOL SaveState (LPCTSTR / * lpszProfileName * / = NULL, int / * nIndex * / = -1, UINT / * uiID * / = (UINT) -1) {return incorrect; }}; Class CMenuBarEx: Public CMFC Menubar {Public: CToolBarEx {} Virtual BOOL LoadState (LPCTSTR / * lpszProfileName * / = NULL, int / * nIndex * / = -1, UINT / * uiID * / = (UINT) -1) {Description Is false; } Virtual BOOL SaveState (LPCTSTR / * lpszProfileName * / = NULL, int / * nIndex * / = -1, UINT / * uiID * / = (UINT) -1) {return incorrect; }};
This is the only way I can use to add dynamic objects to the toolbar or menubar but this is not a solution, I take no advantage of the optimization tool and save the menu bar Posts, is it that Microsoft wants to deal with menus and toolbars? Do not push it once and no change is allowed? Or am I missing something about it? Unfortunately, the way this works, Microsoft classes in its applications from its CMFC Bcg Toolkit in our application.
There was a single problem and resolved it by updating the work location (such as tool bar, menu items, etc.) from the Mainframe class. In addition, we were selected to save the state in an XML file instead.
Comments
Post a Comment