Error Reporting
 
 
 

When an image loader/saver plug-in (derived from class BitmapIO) encounters an error during a bitmap operation (for example "No Disk Space" when attempting to write a bitmap) there is a system flag that controls how the error should be reported to the user.

The image loader/saver base class BitmapIO provides the method BitmapIO::ProcessImageIOError() for reporting errors. This presents a standard dialog that provides the user with options to cancel or retry the operation. So, when a developer runs into an error condition while processing a bitmap, they would use the BitmapIO::ProcessImageIOError() method to report it. Some "common" error messages are already defined, and for those you would simply use one of the error codes defined in BITMAP.H. These are:

More of these exist but are for internal use only. To send your own message, simply pass a TCHAR string instead. The file name and/or device name are taken from the given BitmapInfo object.

The BitmapIO::ProcessImageIOError() returns either BMMRES_ERRORRETRY orBMMRES_ERRORTAKENCARE depending on the users selection from the dialog box. Normally a developer doesn't care about the return value and simply returns it and exits.

The idea of a standard error processing dialog is to control the display of dialogs. For example, when 3ds Max is running in network rendering mode, no dialogs should be displayed. That would cause the machine to just sit there since there would be no user to respond to the dialog.

If you must handle the error yourself (that is, if you want to display your own error dialog), you should first check to see if dialogs are allowed by checking the BitmapManager::SilentMode() method. This method returns a value indicating if dialogs should indeed be displayed or not.