Well

This is a discussion on Well within the C++ Programming forums, part of the General Programming Boards category; Actually... if anyone knows this... I would appreciate it if you share. I used 500 ICON "icon.ico" the last time. ...

  1. #16
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    Actually... if anyone knows this... I would appreciate it if you share.

    I used 500 ICON "icon.ico" the last time. I noticed some people use 100 ICON etc. I opened up my executable in the resource hacker I downloaded and saw that under the ICON group there was folder named '500' instead of the '100' that was there before.

    What does this number mean? What does it do exactly? Can you have more than one Icon with different numbers, or something?


    Edit: Also, what else can be added to the resource file? I have seen that you may be able to change the cursor on mouseover (html term... sorry) and perhaps more. So what are some of the other uses of the resource file? Flex your programming might.


    ~Betazep
    Last edited by Betazep; 02-03-2002 at 03:09 PM.
    Blue

  2. #17
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Stoned Coder, do you feel up to writing how to do it MFC with the MSVC++ compiler.
    Assuming you are creating an app using AppWizard in msvc then you already get a default large and small icon for your app which you only need edit in the ide's resource editor.

    What does this number mean? What does it do exactly? Can you have more than one Icon with different numbers, or something?
    It is the resource id number. It is unique to that particular resource. Yes you can have lots of icons as long as they have unique ID's.

    Also, what else can be added to the resource file?
    Icons,cursors,bitmaps,menus,dialogs,strings,user defined resources and more. More information at msdn.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #18
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    >>>It is the resource id number. It is unique to that particular resource. Yes you can have lots of icons as long as they have unique ID's.

    Can it be any number as long as it doesn't conflict with another resource number?
    Blue

  4. #19
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    As far as i know. You normally name the resources and the IDE takes care of numberring them for you.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #20
    Registered User
    Join Date
    Jan 2002
    Posts
    381
    Every program (even every instance of a program) has its own storage space for resources.
    So yes you can use absloutly any number you wish as for identifiers. This freedom is important as it sometime allows you to avoid some of the huge switch statments that you get with windows.

  6. #21
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    >>>Every program (even every instance of a program) has its own storage space for resources.


    From what I have seen thus far, I am going to have to disagree with you here. My console program didn't have a resource file until I created one. This was proven through the resource hacker that I was using. I had to import the resource file from another program or .res that I created.

    So I believe that every executable that is created with a resource has its own storage space for resources... otherwise it doesn't.

    I am new to this aspect of programming, so please if you feel that I have it incorrect... let me know. But make sure it isn't vague, or I won't believe you.

    My main question on the numbers is are there common numbers for certain resources or can it be any number you choose. Like do most people use...say... 500 for an icon and 250 for a cursor. (or whatever... 100 or 101 for an icon... etc) You answered the choice of number question... but is there a standard that people go by.
    Last edited by Betazep; 02-03-2002 at 11:51 PM.
    Blue

  7. #22
    Registered User
    Join Date
    Jan 2002
    Posts
    381
    Sorry I don't think I expressed that properly.
    What I meant was that every program is allowed to referance in memory a list of resources and allocate them storage. This hides all the identifiers behind the hinstance of the program and eliminates all possible conflicts (apart from those caused be sloppy programming).

    But the way i declare my resource identifiers is to group them and give each goup a range of 1000.
    eg defining all my icons starting at 1000 and going up sequentially.
    Then declaring the main window's menu at 2000, putting the File menu for that as 2100, edit starting at 2200 and so on.

    But i do occasionally stray from logically ordering them to help improve my algorithms. Like making tool tip strings always 1000 higher than the command identifiers of the controls that need them. That really cuts down on the anount of code i need to do things.

  8. #23
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    Thanks... very good information.
    Blue

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21