OLE Automation variable types and other types defined by QM

See also: intrinsic types

 

QM supports 7 OLE-Automation types: FLOAT, CURRENCY, DECIMAL, VARIANT, BSTR, DATE and ARRAY. The first 6 types are mostly used with COM functions. Actually they are user-defined types but in most cases are interpreted like intrinsic types. For example, QM automatically converts between intrinsic types and OLE-Automation types when necessary. However, only few QM intrinsic functions support these types. Other functions convert them to intrinsic types. In expressions with operators, OLE-Automation types are converted to double. For better precision, use member functions.

 

The table shows properties of OLE-Automation types and how they are related to and C++ and C# variable types.

Type FLOAT CURRENCY DECIMAL VARIANT BSTR DATE ARRAY
Numeric Yes Yes Yes *   Yes  
String       * Yes    
Can be x.x Yes Yes Yes *   Yes  
Signed Yes Yes Yes *   Yes  
Size (bytes) 4 8 16
(2 unused)
16** 4** 8 4**
Precision < double ~ double > double *      
C++ float CY DECIMAL VARIANT BSTR DATE,
double
SAFEARRAY*
C# float   decimal object string   arrays

* A variable of VARIANT type can contain value of various types.

** A variable of BSTR type is pointer (4 bytes) to length-prefixed Unicode UTF-16 (double-byte) string, so whole size is 4 + 4 + (num. characters * 2) + 2 bytes. A variable of type VARIANT also can contain BSTR or pointer to data of other type. A variable of type ARRAY is pointer (4 bytes) to array descriptor, which has pointer to array data. Size of array descriptor depends on array type and number of dimensions.

 

QM also defines several other types and interfaces: QMITEM, FILTER, QMERROR, POINT, RECT, SYSTEMTIME, FILETIME, FINDRX, CHARRANGE, REPLACERX, REPLACERXCB, CALLOUT, FINDWORDN, MES, UDTRIGGER, KEYEVENT, GUID, IUnknown, IDispatch IAccessible and several other.