In addition to custom command tables, MCDs can have custom error tables. Error tables are represented as resources to the driver. They are created using the RCDATA type of resource. By default, custom driver error tables are associated with the MCDTABLE and VSDTABLE DLLs specified in the MMPM2.INI file. The resource number is the device type number + MMERROR_TABLE_BASE. For example, the following example shows an RCDATA value of 506. This consists of:
As an alternate, you can add a #define statement in your header file to define the RCDATA value. For example:
#define MMERR_TABLE_MY_DEVICE MMERROR_TABLE_BASE + MCI_DEVTYPE_OTHER
MDM attempts to use these tables whenever mciGetErrorString is called with an error generated by that driver. If the custom error table resource does not exist, then MDM uses its default error table. The error table is a resource.
Error tables are composed of a set of ULONG strings with a special end-of-table identifier as shown in the following example.
RCDATA 506 BEGIN MCIERR_INVALID_DEVICE_NAME, "Invalid Device Name given" MCIERR_SUCCESS, "MMPM Command completed successfully" MCIERR_INVALID_DEVICE_ID, "Invalid device ID given" MCIERR_UNRECOGNIZED_KEYWORD, "Unrecognized keyword" MCIERR_UNRECOGNIZED_COMMAND, "Unrecognized command" MCIERR_HARDWARE, "Hardware error" MCIERR_OUT_OF_MEMORY, "System out of memory" . . . MCIERR_MSG_TABLE_END "" END
Note: If a device does not use a basic command, the MCD can return MCIERR_UNSUPPORTED_FUNCTION. If a device supports the command, but not all of the options, it can return MCIERR_UNSUPPORTED_FLAG.