You must make sure to specify [STAThread] (single-thread apartment model) as an attribute on your app's main function:
[STAThread] public static void Main() { ... }
Certain ABBYY FineReader Engine objects (for example, Blocks, etc.) have read-only object properties. Such properties cannot be changed directly in raw C++. If you want to change such a property, you need to pass a reference to the property object to a new variable, and then use this variable to change it. Below you can see a C++ sample for the Blocks property which is represented by a read-only collection:
ILayout* pLayout = 0; IBlocksCollection* pBlocksCollection = 0; IBlock* pBlock = 0; ... // The pBlocksCollection variable receives a reference to the // blocks collection from Layout pLayout->get_Blocks( &pBlocksCollection ); // Add one more element to the blocks collection pBlocksCollection->Add( pBlock ); ...
No, it is impossible. The Engine object is singleton, so only one object of this type may be created in a single instance of the application that uses ABBYY FineReader Engine. The methods of all ABBYY FineReader Engine objects should be called only from the thread in which Engine object was created.
More details can be found in the documentation chapter: Using ABBYY FineReader Engine.
Yes, it is possible. But there can be only one Engine object in each process. A second call of GetEngineObject within the same process will return the reference to the existing object. Therefore, you should create a separate Engine object for each process by calling the GetEngineObject function.
More details can be found in the documentation chapter: Using ABBYY FineReader Engine.
This exception is thrown if not all the objects which were created and used by the application have been deleted before the Engine object deinitialization. If all the objects have been deleted the exception may be caused by the scavenger operation.
In this environment all objects with the Nothing value are not deleted, they are only marked for deletion. The exact moment when the garbage collector deletes the object is not known. Therefore, you should call the following methods before Engine object deinitialization so that the garbage collector deletes the object:
GC.Collect()
GC.WaitForPendingFinalizers()
More details can be found in the documentation chapter: Using ABBYY FineReader Engine in Delphi.
You can use the StartLogging method of the Engine object to get a list of objects that have not been deleted.
To do this, you need to call the StartLogging method of the Engine object. As input parameters, specify the log file name and the Boolean variable which determines whether method calls messages should be logged or not. Once you have called this method, all messages will be logged. To stop logging, call the StopLogging method of the Engine object.
More details can be found in the documentation chapter: Using ABBYY FineReader Engine in Delphi.