Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

CMFCToolBar vs CToolbar LoadToolBar Usage Changes

$
0
0

Had older VS2005 MFC GUI project, imported to VS2010, that used CToolBar::LoadToolBar for standard toolbar, then upon program state changes called CToolBar::LoadToolBar to display a non-standard toolbar. Worked fine, GUI switching toolbars dynamically.

Now have new VS2010 project, with CMFCToolBar rather than CToolBar, and although initial CMFCToolBar::LoadToolBar in CMainFrameEx::OnCreate works fine, when I attempt to call CMFCToolBar::LoadToolBar when program state changes, the toolbar images do not change, and the toolbar itself becomes disabled, i.e., no event handlers called when buttons are pushed.

If I add some code to call EnableDocking and DockPane after LoadToolBar for the non-standard toolbar, the non-standard toolbar buttons became usable but the toolbar images did not change, i.e., they still showed the standard toolbar images.

What is the proper way with CMFCToolBar to delete an old toolbar and display a new one?


Viewing all articles
Browse latest Browse all 15302


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>