DTWAIN_GetErrorBuffer

Top  Previous  Next

The DTWAIN_GetErrorBuffer returns the errors that DTWAIN has encountered.

 

DTWAIN_BOOL DTWAIN_GetErrorBuffer ( LPDTWAIN_ARRAY Errors );

 

 

Parameters

Errors

   Specifies a pointer to a DTWAIN_ARRAY that on return will be filled with the last errors that have occurred using DTWAIN.

 

 

Return Values

If the function succeeds, TRUE is returned, else FALSE is returned.

 

Comments

The DTWAIN_GetErrorBuffer function takes a pointer to a DTWAIN_ARRAY Errors, and on return copies the errors that have been encountered by DTWAIN to Errors.  To invoke this usage of buffering error messages, the DTWAIN_SetTwainLog must be called with the DTWAIN_LOG_USEBUFFER flag set.

 

The errors are in the order of most recent error first.  In other words, the last error that occurred is the first value in the DTWAIN_ARRAY, the error that

occurred before the last error is the second item in the DTWAIN_ARRAY, etc.

 

The items in the DTWAIN_ARRAY are 32-bit long values, each value denoting one of the DTWAIN Error Constants.

 

To set the maximum number of DTWAIN errors that will be buffered, call DTWAIN_SetErrorBufferThreshold.  By default, DTWAIN will buffer the last 50 errors encountered.

 

Example:

 

DTWAIN_ARRAY errors;

LONG i;

LONG Count;

LONG theError;

//...

DTWAIN_GetErrorBuffer( &errors );

Count = DTWAIN_ArrayGetCount( errors );

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

{

  theError = DTWAIN_ArrayGetAtLong( errors, i );  

  // the Error will be one of the DTWAIN Errors

}

 

TWAIN State Transitions

None

 

Prerequisite Calls

None.

 

See Also

DTWAIN_GetLastError, DTWAIN_SetErrorBufferThreshold, DTWAIN_ClearErrorBuffer