SafeArrayGetVartype Function
Returns the VARTYPE stored in the given safe array.
HRESULT SafeArrayGetVartype( SAFEARRAY *psa, VARTYPE *pvt );
If FADF_HAVEVARTYPE is set, SafeArrayGetVartype returns the VARTYPE stored in the array descriptor. If FADF_RECORD is set, it returns VT_RECORD; if FADF_DISPATCH is set, it returns VT_DISPATCH; and if FADF_UNKNOWN is set, it returns VT_UNKNOWN. For more information about fFeatures flags, see SAFEARRAY Data Type.
SafeArrayGetVartype can sometimes fail to return VT_UNKNOWN for SAFEARRAY types that are based on IUnknown. Callers should additionally check whether the SAFEARRAY type's fFeatures field has the FADF_UNKNOWN flag set.