Some of the objects in ABBYY FineReader Engine are so-called “connectable objects.” This means that they implement the IConnectionPointContainer interface. Connectable objects support communication between ABBYY FineReader Engine and its clients.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.
For Windows users, each of the FRE connectable objects provides connection points of two types — one that uses a dispatch interface and one that uses the interface derived from IUnknown. The dispatch interface is designed for automatic use in Visual Basic and similar environments, while the vtbl-based interface is suitable for use in C++.
Dispinterfaces are Windows-specific.
| Object | Callback Interface (Dispinterface) |
|---|---|
| FRDocument | IFRDocumentEvents (DIFRDocumentEvents) |
| FRPages | IFRPagesEvents (DIFRPagesEvents) |
| FRPage | IFRPageEvents (DIFRPageEvents) |
| ImageDocument | IImageDocumentEvents (DIImageDocumentEvents) |
For Linux and macOS
For Linux and macOS
There are two global methods used for connecting and disconnecting to the notification source:These methods should receive one of the connectable objects as the object argument and the corresponding callback interface as the callback argument.You need to implement the necessary interface and “advise” object implementing the interface to the corresponding connectable objects. We will use the FRDocument object as an example.
- Implement the IFRDocumentEvents interface. As it is derived from the IUnknown interface, the client object should also implement the IUnknown methods:
- Then the CFRDocumentCallback class can be used to receive notifications from the FRDocument object. Advise this object to the notifications source (error handling is omitted):
The remainder of this topic applies to users of FRE for Windows.
Visual Basic .NET
Visual Basic .NET
Simply declare the connectable object WithEvents and implement the methods of the corresponding callback interface. You will also need to explicitly specify the event handler associated with the event.For the FRDocument object, the procedure will be the following:
- Declare the FRDocument object WithEvents:
- Implement the necessary methods of the DIFRDocumentEvents dispinterface in the Sub similar to the following.
- Connect the implemented event handler to the event source, use the FRDocument object for processing, then disconnect the handler:
C++
C++
In C++, you need to implement the necessary interface, obtain a connection point, and “advise” object implementing the interface to the corresponding connectable objects. We will use the FRDocument object as an example.
- Implement the IFRDocumentEvents interface. As it is derived from the IUnknown interface, the client object should also implement the IUnknown methods:
- Then the CFRDocumentEventsListener class can be used to receive notifications from the FRDocument object. Advise this object to the notifications source (error handling is omitted):
C#
C#
C# procedure is similar to that of Visual Basic .NET. You need to implement the necessary methods of the callback interface and connect the implemented event handlers to the event source. We will use the FRDocument object as an example.
- Implement the necessary methods of the IFRDocumentEvents interface:
- Connect the event handler to the event source, use the FRDocument object for processing, then disconnect the handler:
