> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OnWarning Method of the IBatchEvents Interface

This method is implemented on the client side. It is called by ABBYY FlexiCapture SDK for some of the methods of the [**Project**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project.md) and [**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md) objects. It delivers to the client information about the warnings which occur during page processing. You can create, display, and operate a message box in this method.

## Syntax

```vb Visual Basic .NET theme={null}
Sub OnWarning(
  ByVal Page As Page, _
  ByVal Text As String, _
  ByVal Title As String, _
  ByVal Type As Integer, _
  ByRef MessageBoxResult As Integer _
)
```

```cpp C++ theme={null}
HRESULT OnWarning(
  IPage* Page,
  BSTR   Text,
  BSTR   Title,
  int    Type,
  int*   MessageBoxResult
);
```

## Parameters

**Page**

\[in] This parameter refers to the [**Page**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/page.md) object corresponding to the page which is currently processed.

**Text**

\[in] This parameter contains the text description of the warning.

**Title**

\[in] This parameter contains the message box title.

**Type**

\[in] This parameter specifies the contents and behavior of the dialog box. This parameter can be a combination of MB\_\* flags. See Microsoft Documentation ([https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox)) for details.

**MessageBoxResult**

\[in, out] This parameter contains the result of the warning processing.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## Remarks

A client implementation of this method must assure that all exceptions thrown inside the method are caught and handled and no exceptions are propagated outside the method. Propagation of an exception outside the method may lead to unpredictable results (such as program termination).

## See also

[**IBatchEvents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/ibatchevents.md)

[**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md)

[**Project**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project.md)
