MIL_ID ContextAppId, | //in |
MIL_INT64 ErrorType, | //in |
void *ErrorPtr | //out |
This function obtains current or global application error information, for example, error codes, error subcodes, error messages, error submessages, function codes, and function names. This function allows you to check for errors after each MIL function call or to get the first error that occurred after a series of MIL function calls.
A typical use of this function is to check whether a buffer allocation call was successful (MbufAllocColor(), MbufAlloc1d(), and MbufAlloc2d()) or to see if a function returns an error.
In multi-thread environments, an MappGetError() call returns information either with the first error-returning function of the current thread or, if there no errors in the current thread, it checks for errors in the other MIL running threads. To return only errors in the current thread, see the combination constants, described below.
This function can also be used to obtain information about a detected error when error-reporting to the screen has been disabled using MappControl().
To clear errors, call MappControl() with M_CLEAR_ERROR.
Specifies the identifier of the application context to use.
For specifying the application
context
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the current application context. |
||||||||||||||||||||||||||||||||||||||
Application Context Identifier |
Specifies the application context identifier. |
Specifies the type of error information to read. This parameter can be set to one of the values below.
See the Parameter associations section for possible values that can be specified.
Specifies the address in which to write the requested information.
The MappGetError() function also returns the error/function code; if you don't want to get an error message or function name, you can set this parameter to M_NULL.
See the Parameter associations section for possible values that can be returned.
The table below lists possible values for the ErrorType parameter and possible values returned to the ErrorPtr parameter.
Unless otherwise specified, the following values require that you pass the ErrorPtr parameter the address of a MIL_INT.
For specifying the type of error
information to read
|
|||||||||||||||||||||||||||||||||||||||
ErrorType |
Description
|
||||||||||||||||||||||||||||||||||||||
ErrorPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_CURRENT + |
Retrieves the error code returned by the last function call. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CURRENT_FCT + |
Retrieves the opcode associated with the last function called, when it returns an error. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CURRENT_SUB_1 + |
Retrieves the first error subcode returned by the last function call. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CURRENT_SUB_2 + |
Retrieves the second error subcode returned by the last function call. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CURRENT_SUB_3 + |
Retrieves the third error subcode returned by the last function call. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CURRENT_SUB_NB |
Retrieves the number of error subcodes associated with the last function called, when it returns an error. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GLOBAL + |
Retrieves the error code of the first error that has occurred since the last call to MappGetError() (with ErrorType set to M_GLOBAL). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GLOBAL_FCT + |
Retrieves the opcode associated with the first error-generating function since the last call to MappGetError() (with ErrorType set to M_GLOBAL). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GLOBAL_SUB_1 + |
Retrieves the first error subcode of the first error that has occurred since the call to MappGetError() (with ErrorType set to M_GLOBAL). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GLOBAL_SUB_2 + |
Retrieves the second error subcode of the first error that has occurred since the call to MappGetError() (with ErrorType set to M_GLOBAL). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GLOBAL_SUB_3 + |
Retrieves the third error subcode of the first error that has occurred since the call to MappGetError() (with ErrorType set to M_GLOBAL). (more details...) |
||||||||||||||||||||||||||||||||||||||
M_GLOBAL_SUB_NB |
Retrieves the number of error subcodes associated with the first error that occurred since the last call to MappGetError() (with ErrorType set to M_GLOBAL). (more details...) |
You can add one or more of the following values to the above-mentioned values to set whether to return a message, make the inquire synchronous, or limit it to the current thread.
For error types
|
|||||||||||||||||||||||||||||||||||||||
ErrorType |
Description
|
||||||||||||||||||||||||||||||||||||||
ErrorPtr - Possible values returned |
|||||||||||||||||||||||||||||||||||||||
M_MESSAGE |
Retrieves the error message associated with the specified error type, or the function name associated with a function code, and writes it to the address specified by the ErrorPtr parameter. (more details...) |
||||||||||||||||||||||||||||||||||||||
ErrorPtr data type info |
Data
type: array of type MIL_TEXT_CHAR |
||||||||||||||||||||||||||||||||||||||
M_SYNCHRONOUS |
Forces the function to wait for all pending calls to complete before continuing. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_THREAD_CURRENT |
Specifies that only errors are returned in the current thread. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |