Microsoft KB Archive/76411

{|
 * width="100%"|

Adding Custom Error Strings to an MCI Device Driver

 * }

Q76411

-

The information in this article applies to:


 * Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1
 * Microsoft Win32 Software Development Kit (SDK), versions 3.5, 3.51, 4.0

-

SUMMARY
In the Microsoft Windows graphical environment, an application can use mciGetErrorString to obtain the string associated with an error code returned from a media control interface (MCI) device driver.

An MCI driver can use a STRINGTABLE resource to store its error strings. The identifier constant for each string should correspond to the error value returned by the DriverProc function. This value must be greater than or equal to the constant MCIERR_CUSTOM_DRIVER_BASE to avoid confusion with the predefined MCI error codes.

MORE INFORMATION
For example, the Pioneer LaserDisc device driver, MCIPIONR.DRV, included with the Microsoft Device Development Kit (DDK) for Windows 3.1, contains the following declarations in its header file, MCIPIONR.H:

#define MCIERR_PIONEER_ILLEGAL_FOR_CLV (MCIERR_CUSTOM_DRIVER_BASE)
 * 1) define MCIERR_PIONEER_NOT_SPINNING    (MCIERR_CUSTOM_DRIVER_BASE+1)
 * 2) define MCIERR_PIONEER_NO_CHAPTERS     (MCIERR_CUSTOM_DRIVER_BASE+2)
 * 3) define MCIERR_PIONEER_NO_TIMERS       (MCIERR_CUSTOM_DRIVER_BASE+3)

Its resource file, MCIPIONR.RC, contains the following STRINGTABLE definition:

STRINGTABLE BEGIN MCIERR_PIONEER_ILLEGAL_FOR_CLV, &quot;Illegal operation for CLV type disc.&quot; MCIERR_PIONEER_NOT_SPINNING, &quot;The disc must be spun up to perform this \ operation.&quot; MCIERR_PIONEER_NO_CHAPTERS, &quot;Chapters are not supported for this disc.&quot; MCIERR_PIONEER_NO_TIMERS, &quot;All timers are in use. Cannot enable \ notification.&quot; END

When mciGetErrorString receives a value greater than or equal to MCIERR_CUSTOM_DRIVER_BASE, it looks in the driver's resource table for a string with the corresponding identifier.

Additional query words: 3.00 3.10 3.50 4.00 95 win16sdk

Keywords :

Issue type :

Technology : kbWin32SDKSearch kbAudDeveloper kbWin3xSearch kbSDKSearch kbWin32sSearch kbWin32SDK400 kbWin32SDK350 kbWin32SDK351 kbWinSDKSearch kbWinSDK300 kbWinSDK310