3.53 DM_QueryError

Using this function the application can query the reason for the failure of the last DM call. The DM returns the number of errors and the errors themselves.

DM_UInt DML_default DM_EXPORT DM_QueryError
(
  DM_ErrorCode buffp[ ],
  DM_UInt bufflen,
  DM_Options options
)

Parameters

<-> DM_ErrorCode buffp[]

This is an array of error codes. It is filled by the DM, but must be allocated inside the application. If the array is not large enough, the last errors are truncated. To be sure that all error codes stored in DM can be passed to the application, this array should have a size of 32.

-> DM_UInt bufflen

Length of the error code array passed on to the DM.

-> DM_Options options

Currently not used. Please specify with 0.

Return Value

The number of valid errors in the array.

Example

Basic routine for error handling:

static void QueryError()

{

  DM_ErrorCode errorbuffer[32];

  /* buffer for the errors that occurred */

  register int i;

  int errors;  /* number of errors */

 

    if ((errors = DM_QueryError(errorbuffer, 32, 0)))

      for (i = 0; i < errors; i++)

        DM_TraceMessage(DM_ErrMsgText(errorbuffer[i], 0), 0);

}