The Resource File (.rc)

The .rc file defines nonwindow resources. Nonwindow resources are the strings that are displayed in your composite part. Examples are window titles, static text used to label entry fields and list boxes, and the text on push buttons and menu items. These strings are delimited by quotation marks (" ") and can be translated into another language.

Each string that VisualAge inserts in the .rc file is preceded by a resource hame that begins with STRRC, as follows:

STRRC_ToDoList_FrameWindow_title,  "ToDo List"

VisualAge defines numeric resource IDs for these resource names in the .h file, starting with the resource ID you specified for your part in the Class Editor.

You may have strings in your part (such as the application name) that you do not want translated. If that is the case, you can prevent those text strings from being inserted in the resource file by inserting a number sign (#) at the beginning of the text and enclosing the text in quotation marks (" "). This change must be made in the property sheet for the part, not by direct edit in the Composition Editor.

Suppose you do not want a window title to be translated. To prevent VisualAge from inserting the title string in the resource file, edit the window's title property. In the case of the ToDoList part, the modified title appears as follows:

#"ToDo List"

After code generation, no resource definition for the modified title appears in the .rc file. Instead, the hardcoded string appears in the generated .cpp file as part of the defaultTitle( ) function.


Related concepts
The Resource Header File (.h)
Resource Files Generated for Translation

Related procedures
Generating Code

Related references
Class Editor