Error-reporting helpers

File:        API\zerror.h
Included by: zmodeler.h

Description

Helper file zerror.h is the most widely used helper. For that purpose, it have been moved to a native API folder and included by ZModeler initially, so classes, functions and macros from this file are always available.

The main purpose of this file is to provide simplifying macros and ready to use implementation of error-reporting class. Native ZModeler error-reporting is done via supporting of core::IErrorInfo interface. When certain method fails, ZModeler can query this interface on source object to read more info about a failure. The helper class which implements this interface is core::CErrorInfo.

Classes, functions and macros:

class CErrorInfo Native implementation of core::IErrorInfo interface.
ShowErrorMessage Global function for showing error message in message-bar. Two versions of this function available.
ShowMessageDirect Global function for showing error/warning/message in message-bar.
messageBox Message box displaying helper. This function is intended to replace calls to MessageBox or AfxMessageBox API functions. This function does not provide extended functionality of ZModeler-styled message boxes like embedded dialogs or custom controls. But it allows extended behaviour buttons declared in <services/zmServices.h> file.
messageBoxPrepare Prepares ZModeler-styled message box to appear with custom child dialog or child control. Make sure to invoke messageBoxDlg function to show this extended message box.
messageBoxDlg Message box displaying helper. This function is intended to replace calls to MessageBox or AfxMessageBox API functions. This function is expected to show message box with either child dialog or child control in it, inserted with messageBoxPrepare function call.
DialogError Global function for displaying "halt" ("Stop!") dialog box for crytical errors.
hasErrors Helper function is used to determine whether supplied interface has some error information available.
UtilReportError Helper function for formatting and reporting error information to core::IErrorInfo interface.
REPORT_ERROR*(...) Macros for utilizing usage of UtilReportError function. Very widely used in current implementation.
REPORT_ERROR_VIA*(...) Macros for utilizing usage of UtilReportError function when your class inherit core::IErrorInfo interface several times.
REPORT_ERROR_TO*(...) Macros for utilizing usage of UtilReportError function by setting error information on specified object.
DIALOG_ERROR*(...) Macros for utilizing usage of DialogError function by supplying first two arguments into this function.
See Also:
References overview
Helpers overview