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

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

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

このメソッドはクライアント側で実装されます。[Zoom Viewer](/ja/fine-reader/engine/visual-components-reference/zoomviewer) から次のいずれかの方法で開始されたブロック認識処理が始まる前に、ABBYY FineReader Engine によって呼び出されます。

* コンテキストメニューで Read Area 項目を選択する
* Ctrl+Shift+B のホットキーを押す
* IZoomViewer::Commands の [DoCommand](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/commands/docommand-method) メソッドを使用して [MI\_ReadBlock](/ja/fine-reader/engine/visual-components-reference/zoomviewer/zoom-viewer-commands#mi_readblock) コマンドを呼び出す

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

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

[IZoomViewerEvents](/ja/fine-reader/engine/visual-components-reference/izoomviewerevents)

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