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

# IImageViewerEvents インターフェイスの OnReadBlocks メソッド

> Windows 上の ABBYY FineReader Engine Visual Components における IImageViewerEvents インターフェイスの OnReadBlocks メソッド — このメソッドはクライアント側で実装されます。

このメソッドはクライアント側で実装されます。[Image Viewer](/ja/fine-reader/engine/visual-components-reference/imageviewer) から [MI\_ReadBlock](/ja/fine-reader/engine/visual-components-reference/imageviewer/image-viewer-commands#mi_readblock) コマンドを呼び出して開始されるブロック認識処理の前に、ABBYY FineReader Engine によって呼び出されます。このコマンドの呼び出し方法については、[Image Viewer Commands](/ja/fine-reader/engine/visual-components-reference/imageviewer/image-viewer-commands) の一覧を参照してください。

このメソッドは、これから認識されるブロックのインデックスをクライアントに渡します。このメソッドを使用すると、処理をキャンセルできます。

<div id="syntax">
  ## 構文
</div>

<div id="c">
  ### C++
</div>

```cpp theme={null}
HRESULT OnReadBlocks(
  IIntsCollection* BlocksIndices,
  VARIANT_BOOL*    Cancel
);
```

### C\#

```csharp theme={null}
void OnReadBlocks(
  IIntsCollection   BlocksIndices,
  out bool       Cancel
);
```

<div id="visual-basic-net">
  ### Visual Basic .NET
</div>

```vb theme={null}
Sub OnReadBlocks( _
  BlocksIndices As IIntsCollection, _
  ByRef Cancel As Boolean _
)
```

<div id="parameters">
  ## パラメータ
</div>

BlocksIndices

\[in] [IntsCollection](/ja/fine-reader/engine/api-reference/supplementary-objects-and-methods/intscollection) オブジェクトとして認識されるブロックのインデックスが含まれます。

Cancel

\[out] この変数を TRUE に設定すると、処理を中止する必要があることを示せます。この場合、認識は実行されません。

<div id="return-values">
  ## 戻り値
</div>

\[C++ のみ] このメソッドが S\_OK 以外の値を返した場合、クライアント側でエラーが発生したことを示します。この場合、Cancel パラメーターの値は無視されます。

<div id="remarks">
  ## 注記
</div>

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

<div id="see-also">
  ## 関連項目
</div>

[IImageViewerEvents](/ja/fine-reader/engine/visual-components-reference/iimageviewerevents)

[OnReadPage](/ja/fine-reader/engine/visual-components-reference/iimageviewerevents/onreadpage-method)
