> ## 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.

# IBatchEvents インターフェイスの OnWarning メソッド

このメソッドはクライアント側で実装します。ABBYY FlexiCapture SDK は、[**Project**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project.md) オブジェクトおよび [**Batch**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/batch.md) オブジェクトの一部のメソッドの実行中にこのメソッドを呼び出します。このメソッドは、ページの処理中に発生した警告に関する情報をクライアントに通知します。このメソッド内では、メッセージボックスを作成、表示、操作できます。

## 構文

```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
);
```

## パラメーター

**Page**

\[in] このパラメーターは、現在処理中のページに対応する [**Page**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/page.md) オブジェクトを参照します。

**Text**

\[in] このパラメーターには、警告の説明テキストが格納されます。

**Title**

\[in] このパラメーターには、メッセージボックスのタイトルが格納されます。

**Type**

\[in] このパラメーターは、ダイアログの内容と動作を指定します。このパラメーターには、MB\_\* フラグを組み合わせて指定できます。詳細については、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)) を参照してください。

**MessageBoxResult**

\[in, out] このパラメーターには、警告の処理結果が格納されます。

## 戻り値

このメソッドには固有の戻り値はありません。[ABBYY FlexiCapture SDK 関数の標準の戻り値](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/errorcodes.md)を返します。

## 解説

このメソッドをクライアント側で実装する場合は、メソッド内でスローされたすべての例外を確実にキャッチして処理し、例外がメソッドの外部に伝播しないようにする必要があります。例外がメソッドの外部に伝播すると、予期しない結果 (プログラムの終了など) を招くおそれがあります。

## 関連項目

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

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

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