Click to See Complete Forum and Search --> : Re: Menu templates


Dave Lorde
March 29th, 1999, 07:53 AM
If you want to avoid programmatically inserting the menu, you could share one copy of the main menu between the three common doc types by passing the same menu ID to their CDocTemplate constructors, and keep a separate menu (with the extra item) for the fourth doc type to use, passing the ID for this menu to it as usual.


One problem with doing it this way is that the three doc types sharing the main menu will then also share (via the same resource ID) the icon, accelerator table, and string resources. The string resource consists of a number of substrings that describe the document type, so unless you can find a way to munge it, they'll all have the same window title, doc name, file type name, etc.


When we were fiddling with our application menus with a similar objective, we eventually decided it was more trouble to fiddle it than to just keep five separate menus.


With MFC in general, it's usually easier to do it the way MS intended, however tedious, than to try and hack a shortcut.


Dave