String Resources

IDS_SHOW_ERROR_TITLE

The error macros use this constant to load the string resource for the error message box title. Before using the macros, you need to undefine the constant and define it to the string ID that you want it to use. You can do this as many times as needed within a source module.

Example

// Define error title to first property page title.
//
#undef IDS_SHOW_ERROR_TITLE
#define IDS_SHOW_ERROR_TITLE  IDS_GENERAL_PROPPAGE_TITLE

For the error-handling macros to work properly, the control must define the following string IDs and resources:

// These string IDs must be defined in the resource header file.
//
#define IDS_ERR_FORMAT         1   // Generic error format message
#define IDS_ERR_INVALIDENTRY   2   // Invalid entry error format message
#define IDS_ERR_OUTOFMEMORY      7   // Out-of-memory error message

// These string resources must be defined in the resource file.
// The error message does not have to be the same, but the formatting must be present.
//
STRINGTABLE DISCARDABLE 
BEGIN
   IDS_ERR_FORMAT      "Error #%d"
   IDS_ERR_INVALIDENTRY   "Invalid entry for %s"
   IDS_ERR_OUTOFMEMORY   "Out of memory"
END