IWiaAppErrorHandler::ReportStatus method

Handles device status and error messages during image data transfers and displays the messages to the user.

Syntax

HRESULT ReportStatus(
  [in] LONG      lFlags,
  [in] IWiaItem2 *pWiaItem2,
  [in] HRESULT   hrStatus,
  [in] LONG      lPercentComplete
);

Parameters

lFlags [in]

Type: LONG

Not used. Set to 0.

pWiaItem2 [in]

Type: IWiaItem2*

Pointer to the item being transferred.

hrStatus [in]

Type: HRESULT

Device status code.

lPercentComplete [in]

Type: LONG

Percentage completed of current operation.

Return value

Type: HRESULT

Returns hrStatus if recovery from the error is not possible. Otherwise, it returns one of the following values.

Return code Description
S_OK
If hrStatus is an error, the appropriate action was taken to correct the error, and the transfer can continue. If hrStatus is informational, the user was informed with a modeless dialog box and chose not to cancel the transfer.
S_FALSE
The user cancelled the transfer from the error handler modeless dialog box. This value can be returned at any point no matter what hrStatus is.
WIA_STATUS_NOT_HANDLED
No action was taken; that is, no dialog box was presented to the user. The next error handler will be invoked. The order of error handlers is: application, driver, and system default.

 

Remarks

The lPercentComplete parameter enables an error handler window to show progress. For example, a driver might provide an estimate of how long "warming up" takes. The lPercentComplete parameter passed into IWiaAppErrorHandler::ReportStatus is the same value as the lPercentComplete that the driver sets into the WiaTransferParams structure.

An error handler can use the SUCCEEDED and FAILED macros to find out if hrStatus has SEVERITY_ERROR or SEVERITY_SUCCESS.

If hrStatus is SEVERITY_SUCCESS, the user should be allowed to cancel the transfer.

If hrStatus is SEVERITY_ERROR, the error handler should display a modal dialog box owned by the application parent window.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
Header
Wia.h
IDL
Wia.idl
Library
Wiaguid.lib