InitializeEngine Function

This function is used to get a pointer to the IEngine interface. It takes as an input parameter the Customer Project ID number, which is an alphanumeric string common to all the Developer and Runtime licenses your project uses.

Syntax

HRESULT __stdcall InitializeEngine(
  BSTR CustomerProjectID,
  BSTR LicensePath,
  BSTR LicensePassword,
  BSTR FREngineDataFolder,
  BSTR FREngineTempFolder,
  VARIANT_BOOL IsSharedCPUCoresMode,
  IEngine** Engine
);
    
    

Parameters

CustomerProjectID
[in] A string containing the Customer Project ID.

Note: During library initialization the list of all available licenses is searched for a Developer or Runtime License corresponding to this Customer Project ID. If no corresponding license is found, an error for the last checked license will occur. However, you may pass 0 for this parameter and select the license later, by calling the IEngine::SetCurrentLicense method before any other library methods.

LicensePath
[in] Reserved for future use. The empty string "" or Null pointer should be passed.
LicensePassword
[in] Reserved for future use. The empty string "" or Null pointer should be passed.
FREngineDataFolder
[in] Contains the path to the folder in which ABBYY FineReader Engine should store user-specific data. By default, for automatic installation:
/Library/Application Support/ABBYY/SDK/12/FineReader Engine for auxiliary engine data
You may need to change the default value, for example, if the interface language settings for your application must be different from other applications that use FineReader Engine. After changing the default, make sure you have full control permissions on the new data folder.
FREngineTempFolder
[in] Contains the path to the folder for ABBYY FineReader Engine temporary files. By default, it is $TMPDIR/ABBYY FineReader Engine 12 folder.
IsSharedCPUCoresMode
[in] Specifies whether the CPU cores should be used in shared mode. This parameter is ignored in ABBYY FineReader Engine for Mac.
Engine
[out, retval] A pointer to IEngine* pointer variable that receives the interface pointer to the resulting Engine object.

Return values

The function may return the standard return values of ABBYY FineReader Engine functions.

Remarks

Only one Engine object may be created using this function in a single instance of the application that uses ABBYY FineReader Engine. Repeated attempts to create the Engine object will return the same object.

Important! Please notice that the process of creation of the Engine object takes rather long time because it requires loading not only the libFREngine.dylib, but a whole set of other dynamic libraries

It is possible to create and run the Engine object on a multi-processor system, but there can be only one Engine object in each process. A second call to InitializeEngine 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 InitializeEngine function.

It is prohibited to initialize and deinitialize ABBYY FineReader Engine at the entry points of other dynamic libraries, and also in constructors and destructors of static and global objects implemented in dynamic libraries, because they are called at the dynamic library entry points. A user should initialize and deinitialize ABBYY FineReader Engine elsewhere, for example, in main function of an executable module.

During initialization ABBYY FineReader Engine will reset the LC_CTYPE setting to operating system defaults. This fact should be taken into account if your application depends upon locale-dependent services.

You should pass a valid Customer Project ID number as an input parameter. However, you may choose the license which should be used for processing, by calling the SetCurrentLicense method of the Engine object before any of the processing methods. Use the GetAvailableLicenses method to look through the list of the available activated licenses you may use, and the CurrentLicense property of the Engine object to check which license is already selected for use.

Samples

The function is used in all code samples.

See also

Licensing

Modules

DeinitializeEngine

27.04.2022 8:30:37

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.