Handle Object (IHandle Interface)

This object provides access to the handle of a resource in memory. It is returned by some methods which provide access to a bitmap image or a memory block. The object manages memory allocation and allows you to avoid memory leaks while working with these resources.

Important! This interface does not support Automation. This means that it does not work if FlexiCapture SDK is loaded as an out-of-process server.

The object is used in the following situations:

  • If you plan to work with the resource outside FlexiCapture SDK

You can get the handle of the resource via the Handle property and work with it. In this case, if you release the Handle object, the resource is released too. Or you can get the handle and detach Handle object from it (use the Detach method). In this case, you are responsible for releasing the resource.

  • If you plan to pass the resource to other methods of FlexiCapture SDK

You can get the handle of the resource as __int64 via the HandleAsInt64 property. Later you can pass the value of this property to a method of FlexiCapture SDK that requires it. If you release the Handle object, the resource is released too. You can release the resource manually by calling CloseHandle method.

Properties

Name Type Description
Handle HANDLE*, read-only Returns the handle of the resource. You can obtain the handle via this property and work with the resource.
HandleAsInt64 __int64, read-only Returns the handle of the resource as __int64. You can pass the return value of this property to a method of FlexiCapture SDK as an input parameter.

Methods

Name Description
CloseHandle Releases the resource.
Detach Returns the handle and detaches the object from it.
SaveToArray Saves the object contents as an array of bytes.

Output parameter

This object is the output parameter of the following methods:

Samples

C# code

See also

Working with Properties

8/15/2023 1:19:30 PM

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.