DIClientEvents Interface (COM-based API)

This is a callback interface that is used for reporting events from the Client object to the listeners. This interface is implemented on the client side. As it derives from the IDispatch interface, the client object should also implement the IDispatch methods. This interface is designed primarily for use in C++. Visual Basic users that wish to receive notifications from the Client object should declare it WithEvents and implement the following Subs:

Public WithEvents cl As ABBYYFinereaderServer.Client
Private Sub cl_OnJobComplete(ByVal jobId  As String,
                            ByVal result As XmlResult)
...
End Sub

Note. You cannot call the ProcessFile, ProcessFileAsync, ProcessXmlTicket, and ProcessXmlTicketAsync methods in the event handler.

Methods
Name Description
OnJobComplete Provides information about job completion to the client.
Remarks

To receive notifications correctly, please make sure that your application releases control and runs the Windows message loop. See the sample below.

Visual Basic 6.0

Dim WithEvents Client As ABBYYFineReaderServer.Client
Dim Workflow As String
Dim Filename As String
Private Sub StartListening_Click()
  ' The StartListening method is called and then control is released
  Client.StartListening Workflow, True
End Sub
Private Sub ProcessAsync_Click()
   ' The ProcessFileAsync method is called and then control is released
   Client.ProcessFileAsync Workflow, Filename
End Sub
Private Sub client_OnJobComplete(ByVal jobId As String, ByVal result As XmlResult)
   ' Here is a reaction to job completion
End Sub

See also

Client,

Working with Connectable Objects

3/26/2024 1:49:49 PM

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.