Setting and reading Safe Array features
If you refer back to the discussion about Safe Array descriptors, you will notice that one of the descriptor’s fields (fFeatures) stores array attributes. fFeatures is a bit field that describes what type of data is stored in the SAFEARRAY and how the array is allocated. In f90VB, to get information from this field you use SafeArrayGetFeatures. The returned value can then be bit-compared to the constants in Table 2.3.
When you use SafeArrayCreate to create an array, the attributes indicated by flags FADF_HAVEIID, FADF_HAVEVARTYPE, FADF_BSTR, FADF_VARIANT, FADF_UNKNOWN and FADF_DISPATCH will be set automatically, depending on the VT-Type you passed as the first argument to the procedure. Safe Arrays created with SafeArrayCreate are never fixed or static, so you must call SafeArraySetFeatures to set these attributes after you have created the array.
When you create a Safe Array using the two-step mechanism (i.e. calling SafeArrayAllocDescriptor followed by SafeArrayAllocData) you must always set the array attributes and the element size before allocating the data-block of the array.