I have written a Single Document Interface, MFC based program in VC++5. It has a lot of features and I want toolbar buttons for most of them so I have had to create a second toolbar. Everything works fine except that if my toolbar is floated and then closed using the X button, the View menu still shows it as ticked. I want to catch the toolbar being closed and untick the menu item. It’s just a detail but I am hoping to eventually sell my program and if this doesn’t work I think it looks unprofessional. I noticed that this does not happen with the main toolbar that is set up automatically in an SDI program. For this program I think that resizing of the window and undocking the toolbars is quite likely to be done by some users.
So having created the toolbar I added a corresponding entry in the View menu so under View there are items for Main toolbar, Second toolbar and Status bar.
Then in MainFrm.h I declared the second toolbar alongside the main one and added a global shown / hidden flag.