CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2009
    Posts
    1,355

    [RESOLVED] about resource files

    seem the MAINICON is 101. but how are the other const? what is for description, version and others?

  2. #2
    Join Date
    Nov 2003
    Posts
    1,902

    Re: about resource files

    Here is your main reference for resource scripting: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    "MAINICON" isn't part of the resource scripting language. However, it could be #define'd and used as a numeric identifier.
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    It is common to have a "resource.h" that contains #define's for all resource identifiers needed by both C/C++ code and the resource script.

    You may also find resource generation apps useful as well:
    http://www.resedit.net/

    gg

  3. #3
    Join Date
    Apr 2009
    Posts
    1,355

    Re: about resource files

    Quote Originally Posted by Codeplug View Post
    Here is your main reference for resource scripting: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    "MAINICON" isn't part of the resource scripting language. However, it could be #define'd and used as a numeric identifier.
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    It is common to have a "resource.h" that contains #define's for all resource identifiers needed by both C/C++ code and the resource script.

    You may also find resource generation apps useful as well:
    http://www.resedit.net/

    gg
    so version is like:
    VERSION 1.0.0
    until here fine: but like you said about MAINICON, i want to know that values
    how put description and company?

  4. #4
    Join Date
    Apr 2009
    Posts
    1,355

    Re: about resource files

    the 101 is a const or 1 ID that we want?

  5. #5
    Join Date
    Nov 2003
    Posts
    1,902

    Re: about resource files

    >> so version is like:
    The manual will tell you all about it - http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> how put description and company?
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> about MAINICON, i want to know that values
    Give it whatever value you want - it doesn't matter.
    Code:
    #define MAINICON 123
    I recommend using tools to generate your resource scripts.

    gg

  6. #6
    Join Date
    Apr 2009
    Posts
    1,355

    Re: about resource files

    Quote Originally Posted by Codeplug View Post
    >> so version is like:
    The manual will tell you all about it - http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> how put description and company?
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> about MAINICON, i want to know that values
    Give it whatever value you want - it doesn't matter.
    Code:
    #define MAINICON 123
    I recommend using tools to generate your resource scripts.

    gg
    thanks about your recommendation, but in case, i can't use another programs. because my own IDE will create them
    i'm confuse with anotherthing: when i put a wav file in RC file, how can i use it in source file?
    is in these way:

    resource.h:
    #define WAVE 1

    resource.rc
    WAVE WAV "filename.wav"


    main.cpp

    #inclued <resource.h>


    is only these? and now i can use the WAVE in PlaySound() function?
    (i'm asking about the connection bettween rc file and cpp file)

  7. #7
    Join Date
    Nov 2003
    Posts
    1,902

    Re: about resource files

    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    As you can see, there is no "WAV" resource definition statement. So it's treated as a "user-defined" resource: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> ... use the WAVE in PlaySound() function?
    That API does support resources: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> connection bettween rc file and cpp file
    Here are the API's for dealing with resources in your code:
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    gg

  8. #8
    Join Date
    Apr 2009
    Posts
    1,355

    Re: about resource files

    Quote Originally Posted by Codeplug View Post
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    As you can see, there is no "WAV" resource definition statement. So it's treated as a "user-defined" resource: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> ... use the WAVE in PlaySound() function?
    That API does support resources: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    >> connection bettween rc file and cpp file
    Here are the API's for dealing with resources in your code:
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    gg
    thanks for all.
    i readed these page: http://www.winprog.org/tutorial/resources.html
    and now i understand the resource is a 'folder' inside of exe for we use dependents files, instead use a external folder for images\sound\others(you can correct me)
    but let me ask 1 thing: the nameID can be, realy, any number? if so why use 101 instead 1 or 0(zero)(for example)?

  9. #9
    Join Date
    Nov 2003
    Posts
    1,902

    Re: about resource files

    I believe that when Explorer displays an icon for an EXE, it searches the icon resources in the EXE and uses the one with the lowest Id.

    "101" may just be some default value used by IDE's or other apps for authoring resource scripts. I believe the VisualStudio IDE defaults to 101 as the initial resource Id.

    >> the nameID can be, realy, any number?
    For ICON, the manual says:
    Quote Originally Posted by MSDN
    nameID - Unique name or a 16-bit unsigned integer value identifying the resource.
    Not sure if zero is valid.

    gg

  10. #10
    Join Date
    Apr 2009
    Posts
    1,355

    Re: about resource files

    Quote Originally Posted by Codeplug View Post
    I believe that when Explorer displays an icon for an EXE, it searches the icon resources in the EXE and uses the one with the lowest Id.

    "101" may just be some default value used by IDE's or other apps for authoring resource scripts. I believe the VisualStudio IDE defaults to 101 as the initial resource Id.

    >> the nameID can be, realy, any number?
    For ICON, the manual says:
    Not sure if zero is valid.

    gg
    thanks for all. thanks.
    thanks. i learned very, today, about resources. and i see the MAKEINTRESOURCE() function is for give me the resource item. very cool.
    heres a nice link for learn a little more about resources files: http://www.winprog.org/tutorial/resources.html
    thanks for all my friend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured