Thread: Resource question

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    187

    Resource question

    i have been reading some tutrial about resources etc but there is something he never explained like
    Code:
    /*resource.rc*/
    #include "resource.h"
    IDR_MYMENU MENU
    BEGIN
        POPUP "&File"
        BEGIN
            MENUITEM "E&xit", ID_FILE_EXIT
        END
    
        POPUP "&Stuff"
        BEGIN
            MENUITEM "&Go", ID_STUFF_GO
    		MENUITEM "&Do", ID_STUFF_DO
            MENUITEM "G&o somewhere else", 0, GRAYED
        END
    END
    
    IDB_MSKIN BITMAP DISCARDABLE "Skin.bmp"
    why does he add & before stuff and before &file and after G&o etc why does he does that
    in normal c this should be shown as & but it didnt show in the string ??

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    Read the spec for resource files.
    The & tells you which letter to press if you want to drive the menu from the keyboard.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. Sorting out a resource manager
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 11-10-2008, 07:12 PM
  3. WIN32 API Controls used with Resource
    By parad0x13 in forum C++ Programming
    Replies: 0
    Last Post: 07-19-2008, 02:05 PM
  4. Loading an image in from a resource file
    By starcatcher in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 06:44 AM
  5. Lame question on dialog controls appearance
    By Templario in forum Windows Programming
    Replies: 2
    Last Post: 03-18-2003, 08:22 PM