Working with Properties (COM-based API)

The interfaces of COM-based API objects have various properties and methods. Visual Basic users will be familiar with the notion of property, therefore the text below explains how the properties are handled in C++.

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). However, the "Native COM support" in Microsoft Visual C++ makes the handling of properties more like in Visual Basic.

The Open API properties may be of the following types:

Visual Basic type C++ type
Boolean (with two values, True and False) VARIANT_BOOL (with two values VARIANT_TRUE and VARIANT_FALSE)
Long long
Double double
String BSTR, a pointer to Unicode string. Zero value specifies an empty string.
Byte byte
Object IUnknown - derived interface

See the details of working with different types of properties below:

Working with simple properties

Working with string properties

Working with object properties

26.03.2024 13:49:49

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.