SafeArraySetFeatures
f90VB Modules
f90VBDefs, f90VBSafeArrays
Summary
Sets the contents of the fFeatures field of a Safe Array descriptor.
Syntax
| subroutine SafeArraySetFeatures | (SARef, Features, iRet) |
| { | |
| integer(SAFEARRAY_KIND),intent(in):: | SARef | |
| type(FSafeArray),intent(in):: | SARef | |
| } | |
| integer(SHORT_KIND),intent(in):: | Features |
| integer(HRESULT_KIND),intent(out),optional:: | iRet |
Arguments
SARef [Input]
A handle to, or a Fortran Safe Array structure containing a handle to, an allocated Safe Array descriptor.
Features [Input]
New content for the fFeatures field of the Safe Array descriptor in SARef.
iRet [Output, Optional]
Upon return, iRet contains S_OK or an error code. See comments for more information.
Comments
Note that SARef must be a reference to an allocated Safe Array descriptor.
The fFeatures field contains flags that describe attributes of an array that can affect how the array is released. The field describes what type of data is stored in the Safe Array, and how the array is allocated. This allows freeing the array without referencing its containing variant. The bits are accessed using the following constants:
| fFeatures | Flags | Description | |
| FADF_AUTO | 0x0001 | The array is allocated on the stack. | |
| FADF_STATIC | 0x0002 | The array is statically allocated. | |
| FADF_EMBEDDED | 0x0004 | The array is embedded in a structure. | |
| FADF_FIXEDSIZE | 0x0010 | The array may not be resized or reallocated. | |
| FADF_RECORD | 0x0020 | The array containing records. When set there will be a pointer to the IRecordInfo interface at negative offset 4 in the array descriptor. | |
| FADF_HAVEIID | 0x0040 | The array that has an IID identifying interface. When set there will be a GUID at negative offset 16 in the array descriptor. This flag is set only when FADF_DISPATCH or FADF_UNKNOWN is also set. | |
| FADF_HAVEVARTYPE | 0x0080 | The array that has a VT-Type. When set there will be a VT tag at negative offset 4 in the array descriptor that specifies the element type. | |
| FADF_BSTR | 0x0100 | The array elements are BSTRs. | |
| FADF_UNKNOWN | 0x0200 | The array elements are IUnknown interfaces (IUnknown*) | |
| FADF_DISPATCH | 0x0400 | The array elements are IDispatch interfaces (IDispatch*) | |
| FADF_VARIANT | 0x0800 | The array elements are Variants. | |
| FADF_RESERVED | 0xF0E8 | Reserved | |
To set more than one feature use a bit-wise OR function (IOR).
Argument iRet
Indicates success or failure of the subroutine. The following codes can be returned in this argument:
| Value returned in argument iRet | Description | |
| S_OK | Success. | |
| E_INVALIDARG | The item pointed to by SARef is not a Safe Array descriptor | |
Examples
See examples for SafeArrayGetFeatures.
Related Topics
| For information about | See | |
| Obtaining the features of a Safe Array | SafeArrayGetFeatures, SafeArrayFeatures | |
| Creating a Safe Array | SafeArrayCreate | |
| Allocating a Safe Array descriptor | SafeArrayAllocDescriptor | |