
Using the MintMT ActiveX Control 4-5
All MintMT keywords that call MML functions can be called via the MintMT ActiveX control. They are
prefixed with set for writes, get for reads and do for commands.
4.6 Error Handing
Depending on the state of the controller and the parameters passed, function calls made by the MintMT
ActiveX control may fail. If a function call fails for any reason a dialog box will be displayed containing a
description of the error. For example:
There may be instances within an application where corrective action may be preferable to displaying a
dialog box in the case of a function call failing.
If any property or method call on the MintController object fails it will generate an exception. In
programming terms, an exception is an unexpected event that happens during the execution of a program.
Many modern programming languages now support some form of exception handling. Essentially, an
exception is an error, and this error is 'thrown' from the place in the code where it occurred and (hopefully)
'caught' somewhere else in the code. This somewhere else could be within the same function, or the
calling function or the calling function of the calling function, etc.
The exception will contain a description and also an error code. If it is not handled then a dialog box with a
description of the error will be displayed. Handling the exception allows the error code returned by the
function to be checked and appropriate action to be taken.
The example below is written in Visual C++ and will catch OLE Dispatch Exceptions. The error code is
checked and a dialog box will display a different message based on the return code (m_controller is
the name of the MintMT ActiveX control in the project).
Comentarios a estos manuales