Description
Logs an error to the EventLog and optionally shows an error message dialog.
-
Return Type
-
A mcShowErrorFlags enumeration.
mcShowErrorFlags* : The Flags used internally are returned. These flags will indicate whether localization was done and with which module. They also indicate whether the error message box was displayed or not, and whether the error was ignored or treated as a warning.
-
Syntax
-
object.ShowError ([OverallDescription], [ErrorInfo], [Module], [Flags], [ErrorCode])
The ShowError Method syntax has these parts: |
| object | An expression evaluating to an object of type McApplication. | | OverallDescription | Optional. A String value. An overall description of the error. If this is left blank or is the same as the Description property in the ErrorInfo argument, then it is not used. If it is different than the ErrorInfo.Description property, then it is displayed first.
| | ErrorInfo | Optional. A Variant value. Either a VB ErrObject instance or an IErrorInfo instance. The Description, HelpContext, HelpFile and Source fields are taken from the supplied object. If the object is an ErrObject, then the
| | Module | Optional. A String value. BSTR : The module to be used for localizing the OverallDescription argument and for localizing any ErrorInfo Help Context. It is only used for localizing the ErrorInfo argument's Description property if the Flags mcsefUseModuleForLocalize is set. Localization can be selectively turned off bits in the Flags argument.
| | Flags | Optional. A mcShowErrorFlags enumeration, as described in settings. mcShowErrorFlags : The flags control whether localization is done, whether the error message box is shown, and how the error is treated.
| | ErrorCode | Optional. A Long value. long : If ErrorInfo is not supplied as a VB ErrObject (which supplies the ErrorCode in its Number property), then the error code should be supplied via this argument.
| Settings The settings for Flags are:
 | mcsefNoFlags | 0 |
This is the default behavior. The OverallDescription is localized using the Module argument, and any ErrorInfo Descripition is not localized. The ErrorInfo Help Context ID is localized using the Module.
|
 | mcsefDoNotLocalizeOverall | 1 |
If set, do not localize the OverallDescription passed to ShowError before display. If the OverallDescripion is localized, the Module argument is used.
|
 | mcsefLocalizeErrorInfo | 2 |
If set, Localize the Description in the ErrorInfo argument before display. The ErrorInfo Source property up to any period is used as the module for the localization unless the mcsefUseModuleForLocalize flag is set.
|
 | mcsefDoNotLocalizeHelpContext | 4 |
If set, do not Localize the Help Context ID in the ErrorInfo argument before display. Note that the Help Context ID is always localized using the Module argument.
|
 | mcsefUseModuleForLocalize | 8 |
If set when localizing the ErrorInfo Description property, then the Module argument is used for the Localized call's module. If not set, the Source property (up to any period) in the ErrorInfo argument is used as the Localized module for this description. The Help Context ID is always localized using the Module argument.
|
 | mcsefForceDisplayOn | 16 |
If set then display of the message box is forced on, irrespect of the user's preference setting. One of the AfterError event sinks can still override this. If both mcsefForceDisplayOn and mcsefForceDisplayOff are set, then mcsefForceDisplayOn takes precedence.
|
 | mcsefForceDisplayOff | 32 |
If set then display of the message box is forced off, irrespect of the user's preference setting. One of the AfterError event sinks can still override this. If both mcsefForceDisplayOn and mcsefForceDisplayOff are set, then mcsefForceDisplayOn takes precedence.
|
 | mcsefForceWarning | 256 |
If set then the error is treated as a warning, irrespective of its ErrorCode's category bits. Normally an ErrorCode with the mceErrCatInterrupted is ignored, and ones with any of the other mceErrCat... category bits set are treated as warnings. Use this bit to force treatment as a warning.
|
 | mcsefForceError | 512 |
If set then the error is treated as a severe error and not a warning, irrespective of its ErrorCode's category bits. Normally an ErrorCode with the mceErrCatInterrupted is ignored, and ones with any of the other mceErrCat... category bits set are treated as warnings. Use this bit to force treatment as an error.
|
 | mcsefForceIgnore | 1024 |
If set then the error is ignored, irrespective of its ErrorCode's category bits. Normally only an ErrorCode with the mceErrCatInterrupted is ignored, and ones with any of the other mceErrCat... category bits set are treated as warnings. The caller or AfterError event sink routine can use this bit to cause the error to be ignored.
|
|