For full-screen applications, text messages-used by an application to display information to the user-can be held in a message file.

To keep and maintain messages in a message file, create a separate message file for each national language you intend to support. Use the MKMSGF utility program to create a binary version of a message file, and the MSGBIND utility program to bind the binary file to the application's executable file. Binding the messages to an application's executable file inserts the messages into the .EXE file. This enables faster access (but, of course, a larger .EXE file).

OS/2 provides several functions to assist in message management. Applications can get messages from a message file, substitute variable information into the messages, and write messages to the screen or to a file.

Code Page Considerations
You can have versions of the message file for each code page you choose to support. When you use MKMSGF to create the message files, the utility will insert the code page information and link together the message files of the different versions.

When message files are linked together in this manner, DosGetMessage will search for the appropriate version of the message for the code page that is active at the time the function is called. If there is no version of the message for the current code page, the function will return the first version of the message, no matter which code page it is associated with.

Note: To create portable source code for message files, make sure you specifically set the code page in CONFIG.SYS using the CODEPAGE statement. If you have the wrong code page, or use the default code page, which could be wrong, DosGetMessage returns error code 37 (ERROR_CODE_PAGE_MISMATCHED).


[Back] [Next]