我用了以后怎么是错误的呀?

解决方案 »

  1.   

    当然可以。Example// The code fragment below shows how to use ON_COMMAND_RANGE macro
    // to map a contiguous range of command IDs to a single message 
    // handler function (i.e. OnFileMenuItems() is the sample below). In 
    // addition, it also shows how to use CheckMenuRadioItem() to check a 
    // selected menu item and makes it a radio item.
    BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
       //{{AFX_MSG_MAP(CMainFrame)
       // ... 
       //}}AFX_MSG_MAP
       ON_COMMAND_RANGE(ID_FILE_MENUITEM1, ID_FILE_MENUITEM3, OnFileMenuItems)
    END_MESSAGE_MAP()void CMainFrame::OnFileMenuItems(UINT nID)
    {
       CMenu* mmenu = GetMenu();
       CMenu* submenu = mmenu->GetSubMenu(0);
       submenu->CheckMenuRadioItem(ID_FILE_MENUITEM1, ID_FILE_MENUITEM3, 
          nID, MF_BYCOMMAND);
    }
      

  2.   

    楼上说的完全正确。
    afx_msg void OnFileMenuItems(UINT nID);