Menu

LoadAccelerators function return Null Handle

2006-09-06
2012-09-26
  • Nobody/Anonymous

    Hi All

    in WinMain, LoadAccelerators function always return a null handle hAccel ???????

    // main.cpp
    // before messageloop

    ...
    ...
    // Loading of keyboard accelerators
    hAccel = LoadAccelerators(hInst, (LPCTSTR)"MyAccel");
    if (!hAccel) MessageBox(NULL, "The accelerator table was not loaded", "", MB_OK);

    while (GetMessage(&msg, NULL, 0, 0))....
    ......
    ......

    // resource.rc

    ....
    POPUP "&File"
    {
    MENUITEM "Q&uit", IDM_FILE_EXIT
    }
    ...
    ...

    MyAccel ACCELERATORS DISCARDABLE
    {
    "G", IDM_FILE_EXIT,CONTROL, VIRTKEY
    }

     
    • Nobody/Anonymous

      is the resource file actually compiled and linked in?

       
    • pronecracker

      pronecracker - 2006-09-07

      Quite often any resource files you add to your project don't get linked by default. You can change that in Project Options, tab Files

       
    • Nobody/Anonymous

      sorry correct link is

      http://macgile.free.fr/LoadAccelerators.zip

      Macgile

       
    • Nobody/Anonymous

      Hi all

      Thank's

      1)
      is the resource file actually compiled and linked in?

      Yes

      2)
      Quite often any resource files you add to your project don't get linked by default. You can change that in Project Options, tab Files

      All file is linked and appear in file tab

       
    • Nobody/Anonymous

      You can download project to
      http://macgile@macgile.free.fr/LoadAccelerators.zip

      Macgile

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.