Working with Properties
The interfaces of ABBYY FineReader Engine objects have various properties and methods. In general, properties represent information about an object, whereas methods represent actions an object can take.
For a C++ user, a property is a pair of methods (get and put for read-write properties) or a single get method (for read-only properties).
The ABBYY FineReader Engine properties may be of the following types:
- VARIANT_BOOL (with two values VARIANT_TRUE or VARIANT_FALSE)
- int
- double
- BSTR, a pointer to Unicode string. Zero value specifies an empty string.
- __int64
- HANDLE*
- IUnknown-derived interface
- enum
See the details of working with different types of properties below:
Working with simple properties
Working with string properties
Working with object properties
Working with read-only object properties
Certain ABBYY FineReader Engine objects (for example, ILayout::Blocks) have read-only object properties. This does not mean that such properties cannot be changed, this only means that they cannot be changed by directly replacing the object property with another object, because "put" method is not supported. However, you can change the sub-properties of these objects.
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 ILayout::Blocks property which is represented by a read-only collection:
// We assume that a page has been already opened ILayout* pLayout = 0; ILayoutBlocks* pLayoutBlocks = 0; int blockIndex = 0; // Receive the layout from the previously opened FRPage pFRPage->get_Layout( &pLayout ); // The pLayoutBlocks variable receives a reference to the blocks collection from Layout pLayout->get_Blocks( &pLayoutBlocks ); // Remove an element from the block collection pLayoutBlocks->DeleteAt( blockIndex ); // Work with modified layout ... // Release the objects pLayoutBlocks->Release(); pLayout->Release();
03.07.2024 8:50:25