PropVariantGetElementCount function (propvarutil.h)

Retrieves the element count of a PROPVARIANT structure.

Syntax

PSSTDAPI_(ULONG) PropVariantGetElementCount(
  [in] REFPROPVARIANT propvar
);

Parameters

[in] propvar

Type: REFPROPVARIANT

Reference to the source PROPVARIANT structure.

Return value

Type: ULONG

Returns the element count of a VT_VECTOR or VT_ARRAY value: for single values, returns 1; for empty structures, returns 0.

Remarks

This function works for all valid PROPVARIANT types. See PROPVARIANT for the valid type combinations.

This function is useful to get the count of elements to iterate through using a looping statement, especially for iterations that call functions such as PropVariantGetUInt32Elem or PropVariantGetElem.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header propvarutil.h
Library Propsys.lib
DLL Propsys.dll (version 6.0 or later)
Redistributable Windows Desktop Search (WDS) 3.0