1

I am maintaining an MFC project, there is something strange about the .rc file. I inserted an menu in Resource View and I added two items in this menu.

Visual Studio assigns two IDs to these two items. Assume that the ID is 1000 and 1001. In resource.h,we can find #define ID_MENU1_SUB1 1000 and #define ID_MENU2_SUB2 1001, this is okay. But in .rc file:

IDR_MENU MENU

BEGIN    
    POPUP "MENU1"
    BEGIN
        MENUITEM "Sub1",                        ID_MENU1_SUB1
        MENUITEM "Sub2",                        1001
    END
END

Why is ID_MENU1_SUB2 automatically replaced by 1001, even if the compilation has no problems. How can we avoid this.

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
YL.Qin
  • 11
  • 1
  • 1
    I also saw this Problem from time to time in older VS-Versions. Seamed to be a bug. What VS Version are you using? – xMRi Apr 01 '16 at 10:08
  • Thank you. I saw the change history, I think the version may be 2010 or 2012. Because every year we update the VS, I am afraid that I can't confirm accurate version about vs. – YL.Qin Apr 05 '16 at 02:13
  • And I also can't find any topic about this in msdn. – YL.Qin Apr 05 '16 at 02:19

0 Answers0