Thread: .rc and resource.h file editing

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    25

    .rc and resource.h file editing

    i was looking at this tutorial on creating a window, did that, then went on to dding some of the stuff, one of the things was adding menus. i read that and it talked about making? or editing? a .h file called resource.h, and making? or editing? a .rc file.
    the tutorial is not specific enough for me to understand how to do the above, it jst says to do it, which i dont know how to.
    the site im looking at is here #include "resource.h"

    http://winprog.org/tutorial/index.html
    ^ the site ^
    i am using mvc++ 5.0 professional

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    "making" is a compiler specific. I know the old MS compilers for DOS would allow ou to write simple scripts specifying how the project was to be compiled and what was to be linked with what. "editing" is just entering text with a text editor. In future you would want to put questions like this in the Windows Programming forum.

  3. #3
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    You can make

    You can also find one from another prog and edit if you would like.

    Some compiler implementations automatically create a .rc file, If yours does you could just edit that one OR make a new one. Its all up to you

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Sean I am thinking he is talking about making a header file and a resource file. I know that that tut doesn't explain everthing bit by bit(cause he's assuming your already a semi-decent c language coder). but all you are doing there is making a header file with all your defines in it for all your menus and such. eg:
    Code:
    //resource.h
    #define myMenu 100
    #define myMenuItem 200
    Which is basically giving these things a unqiue identifier then when you want to make a menu with them you do this
    Code:
    //menu.rc
    #include "resource.h"//this is so you can use myMenu 
    
    myMenu MENU//making a menu with the identifer myMenu
    BEGIN
        POPUP "&File"
        BEGIN
            MENUITEM "E&xit", myMenuItem//making a menu item with the idenifer myMenuItem
        END
    END
    I hope this kinda makes sense to you
    Woop?

  5. #5
    Registered User
    Join Date
    Jul 2004
    Posts
    25
    i mostly get wut the header and .rc files are for, i jst want to know how to make one/edit one in the mvc++ program instead of editing one from something else outside of it

  6. #6
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Ah well you should be able to create a project and then add a header file to it and then add a resource file to it but i have heard about ms being a little quirky when it comes to making your own resource files
    Woop?

  7. #7
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    It should be an option when adding a file into a project. Once you've done that it'll come up like a regular text or source file in the IDE.

  8. #8
    Registered User
    Join Date
    Jul 2004
    Posts
    25
    oo ya, stupid me i totally forgot about that. and the tutorial send that microsoft was very "quirky" when making your own rc file

  9. #9
    Registered User
    Join Date
    Apr 2004
    Posts
    29

    There Are Default Values

    Quote Originally Posted by killdragon
    i was looking at this tutorial on creating a window, did that, then went on to dding some of the stuff, one of the things was adding menus. i read that and it talked about making? or editing? a .h file called resource.h, and making? or editing? a .rc file.
    the tutorial is not specific enough for me to understand how to do the above, it jst says to do it, which i dont know how to.
    the site im looking at is here #include "resource.h"

    http://winprog.org/tutorial/index.html
    ^ the site ^
    i am using mvc++ 5.0 professional

    I use the same VC5.0 pro. Yes the .h and .rc files are made for you but the menu will already have a value. It is the same value as if you right-click on the menu tree and choose Properties and it shows the name. This is the name of your menu which your WindowMessage recognizes your menu by. Changing this default name may cause problems unless you know excactly what to do (which I don't) , so unless you are really picky and creative with naming all of your values just leave it.

    If you have already made a resource and a menu is what you are adding next just select it from the compiler menu (I think it is Insert-New Resource, but I haven't opened my compiler in a while.). then just select Menu.

    www.edwardtisdale.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. .rc files in VC8
    By jsrig88 in forum Windows Programming
    Replies: 6
    Last Post: 05-10-2008, 06:01 PM
  2. Menu like file, edit, help, etc...
    By Livijn in forum Windows Programming
    Replies: 44
    Last Post: 01-23-2007, 05:49 PM
  3. Need an interface written
    By Thantos in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 11-23-2005, 11:19 PM
  4. resource file problem
    By jjj93421 in forum Game Programming
    Replies: 6
    Last Post: 03-30-2004, 10:58 PM
  5. Resource File Help
    By gcn_zelda in forum Windows Programming
    Replies: 1
    Last Post: 06-07-2003, 08:36 AM