MFC resource-script file: Control description replaced by Control ID

123 Views Asked by At

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.

0

There are 0 best solutions below