Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Howto Add Comments to Resourc (.rc) file

Status
Not open for further replies.

Malachi

Programmer
Aug 13, 2001
38
0
0
US
How can I add my own comments to a Resource (*.rc) file using the MSVC++ IDE?
 
Since .rc is automatically generated, you should put any of your own comments, etc. in a .rc2 file

Code:
//
// TEST.RC2 - resources Microsoft Visual C++ does not edit directly
//

#ifdef APSTUDIO_INVOKED
	#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...

/////////////////////////////////////////////////////////////////////////////
 
Oh, o.k. thanks. However, this method makes no sense to me ( maybe it does to Bill G. ). Why should I make a .rc2 file? The original .rc file was crafted by hand, and when opened in the MSVC++ 6.0 IDE I was greeted by a message indicating that the .rc file was not created using MSVC++ and needed to be modified in order to work with the IDE. Now, this modification added comments, include directives, moved lines and changed my original spacing.

So now, when I view the resource file in the IDE by choosing the Resource tab, all I see are the object ID's presented in this nifty Windows Explorer type of directory listing. I can click on the ID of my choice, or Bitmap or whatever, and view a graphic representation in the right-hand window. Now, there is a "paint" type of interface that let's me drag and draw GUI components. Fun!

But, as a practice, whenever I make changes to the resource file, I like to add comments indicating what changed within the same file. There doesn't appear to be a means of adding text comments to the Resource file via the Resource Explorer. The alternative suggested; create a .rc2 file in order to log my changes, is not gonna work for me. Isn't there some other way to log my changes within the .rc file WHILE using the MSVC++ 6.0 IDE? I also want to view the comments in the IDE too, within the Resource Explorer.

I appreciate your help and send my thanks in advance.

 
A double '/' makes the rest of the line be a comment

// so, this entire line is comment
// Under here comment after a valid line:

IDI_ICON1 ICON DISCARDABLE "x\\y\\z.ico" // Comment about the icon

Marcel

 
Right click the resource folder and "View Resource Includes" at the bottom, add comments (and other stuff if you know what you need to add) and when you click OK you will see a message stating that what you typed will be copied verbatim. As long as you are adding comments you will not effect the app.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top