Resources

You define resources in a resource file. A resource file is a file that contains data that your application uses, such as text strings and icons. For example, you can define a menu, string table, or dialog templatemenu or string table in the resource file. You also define the string ID, corresponding to each static string you use in a window, in the resource file.

The resource compiler produces a compiled version of the resources, which is then incorporated into the application's executable code or stored in a dynamic link library (DLL) for use by one or more applications.

A benefit of defining resources in a resource file is that you can make changes to resource definitions without affecting the application code itself.

You can also provide national language versions by storing the resources for each language in a separate resource file. You can then build your application as separate executable versions for each language (each with a different resource file bound to it) or as a single executable with a separate DLL for each language.


Window Resources

Window resources are read-only data segments stored in an application's .exe file or in the dynamic link library's .dll file.

Predefined Open Class Class Library window resources include keyboard accelerator tables, icons, menus, and bitmaps.

Most window resources are stored in a format that is unique to each resource type. The system translates the formats, as necessary, for use in functions.

To access window resources, you must prepare a resource file (ASCII file with the extension .rc). Then the ASCII resource file must be compiled into binary images using the resource compiler. The compiled resource extension is it can be linked to your application's .exe file or to a dynamic link library's .dll file.


Dialog Templates

A dialog template is a data structure that describes a dialog window and its control windows. Windows and PM uses the data in the dialog template to create the dialog window and control windows. An application can create a dialog template at run time, or it can use the system resource compiler to create a dialog-template resource.

Motif does not support dialog templates. If you write portable applications, use canvases instead of dialog templates. The Hello World 4 sample application shows you how to do this.



Menus


Converting Application Resources
Hello World Version 4: Adding Dialogs and Push Buttons


IAccelerator
IAccelTblHandle
IDBCSBuffer
IResourceID
IResourceLibrary
IString