Using the Message Compiler

The previous example showed that you can obtain localized strings for Win32 errors, but that you can also create your own errors and provide localized strings that are bound as resources to your process or library. If you intend to report errors to the end user, you have to make sure that the descriptions are localized. Windows provides a tool called the Message Compiler (mc.exe) that will take a text file with entries for messages in various languages and compile them into binary resources that can be bound to a module.

For example:

    LanguageNames = (British = 0x0409:MSG00409)     LanguageNames = (French  = 0x040c:MSG0040C)      MessageId       = 1     SymbolicName    = IDS_GREETING     Language        = English     Hello     .  Language = British ...

Get Beginning C++ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.