1

我有一个 MFC MDI 应用程序,我最近从 VS2003 移植到 VS2008,同时从 Stingray Objective Studio 2006 v2 转移到 v10.1。在我的应用程序的早期版本中,如果我打开了多个视图,则窗口菜单将由可用视图的枚举列表填充,例如1 MyViewA2 MyViewB等...如果我有大量视图,我还将获得一个Windows...菜单选项,以允许我选择一个视图。这不再发生,这破坏了我的一些 GUI 级回归测试。我的猜测是这个功能是由 CMDIFrameWnd 或 SECMDIFrameWnd 实现的,但我在文档中找不到对它的引用。有谁知道我怎样才能恢复这个功能。

4

1 回答 1

1

First thing I'd do is create a new MDI application with the ClassWizard and check if the functionality you're missing is present. If so, poke around and see if you can tell what's different. One place to look may be the menu resource for the main menu.

If there is no in-built functionality to provide what you need, you can dynamically build the menu with the following pseudocode:

foreach registered CDocumentTemplate 
    foreach document
        foreach view
        {
            if (numberOfWindowMenuItems < 5)
            {
                Add menu item
            }
            else
            {
                Add "Windows..." menu item
                break all loops;
            }
于 2009-08-07T01:29:05.770 回答