OLE Automation variable types and other types defined by QM

QM supports 7 OLE-Automation types: FLOAT, CURRENCY, DECIMAL, VARIANT, BSTR, DATE and ARRAY. These 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 VB6 and C++ 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 *      
VB6 Single Currency Decimal Variant String Date arrays
C++ float CY,
__int64/10000
DECIMAL VARIANT BSTR DATE,
double
SAFEARRAY*

* 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.