Error Code 1812

Hi !!
I am using LoadMenu Win32 Call but ,
it gices me Error Code 1812.
I similar application I don't have this problem. I looked at Help of VC++
it says :

1812 The specified image file did not contain a resource section.  ERROR_RESOURCE_DATA_NOT_FOUND

How would I resolve this error ?

Thanks

mab11Asked:
Who is Participating?
 
arikkaConnect With a Mentor Commented:
The LoadMenu function loads the specified menu resource from the executable (.EXE) file. The second parameter is lpMenuName -  null-terminated string that contains the name of the menu resource. Alternatively, this parameter can consist of the resource identifier (MAKEINTRESOURCE macro)

I.
=======================================
1. Make sure you eneter correct name;
2. Make sure you link your EXE with
   the resourse;
3. Check  the resource and make sure
   that menu resource exist there.
======================================

II.

See example:

Your C++ code :
m_hMenu = LoadMenu( m_hInst, MAKEINTRESOURCE(IDM_MENU) );

In your resource file : bla-bla.RC
should be something like
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDM_MENU MENU DISCARDABLE
BEGIN
    POPUP "Root"
    BEGIN
        MENUITEM "CreateGroup",                 ID_ROOT_CREATEGROUP
        MENUITEM "EnumRootGroups",              ID_ROOT_ENUMROOTGROUPS
        MENUITEM "Refresh",                     ID_ROOT_ENUMRECURSIVE
    END
    POPUP "Group"
    BEGIN
        MENUITEM "CreateGroupInGroup",          ID_CREATEGROUPINGROUP
        MENUITEM "DestroyGroup",                ID_DESTROYGROUP
        MENUITEM "SetGroupName",                ID_GROUP_SETGROUPNAME
        MENUITEM SEPARATOR
        MENUITEM "StartSession",                ID_GROUP_STARTSESSION
        , GRAYED
        MENUITEM "ConnectionSettings",          ID_GROUP_CONNECTIONSETTINGS
        , GRAYED
    END
    POPUP "Player"
    BEGIN
        MENUITEM "DestroyPlayer",               ID_PLAYER_DESTROYPLAYER
        MENUITEM "GetPlayerName",               ID_PLAYER_GETPLAYERNAME
        MENUITEM "SetPlayerName",               ID_PLAYER_SETPLAYERNAME
    END
    POPUP "Shortcut"
    BEGIN
        MENUITEM "DeleteGroupFromGroup",        ID_SHORTCUT_DELETEGROUPFROMGROUP

        MENUITEM "SetGroupName",                ID_SHORTCUT_SETGROUPNAME
    END
    POPUP "PlayerInGroup"
    BEGIN
        MENUITEM "DeletePlayerFromGroup",       ID_PLAYERINGROUP_DELETEPLAYERFROMGROUP

        MENUITEM "SetPlayerName",               ID_PLAYERINGROUP_SETPLAYERNAME

    END
END
0
 
mab11Author Commented:
Edited text of question.
0
 
mab11Author Commented:
I checked all of the above,
looks normal to me
0
 
arikkaCommented:
1. Pls give some code examples from
   RC file and CPP/C where you use
   LoadMenu
2. What configuration do you work with?
   WIN32DEBUG,WIN32UNICODE?
3. Make sure you have the same
   configuration in your two projects.
0
All Courses

From novice to tech pro — start learning today.