FreePropVariantArray function (propidl.h)

Frees the memory and references used by an array of PROPVARIANT structures.

Syntax

HRESULT FreePropVariantArray(
  [in]      ULONG       cVariants,
  [in, out] PROPVARIANT *rgvars
);

Parameters

[in] cVariants

Type: ULONG

The number of elements in the array specified by rgvars.

[in, out] rgvars

Type: PROPVARIANT*

Array of PROPVARIANT structures to free. When this function successfully returns, the PROPVARIANT structures in the array are zeroed and their type is set to VT_EMPTY.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This function releases the memory and references held by each structure in the array before setting the structures to zero.

This function performs the same action as ClearPropVariantArray, but returns an HRESULT.

Examples

The following example, to be included as part of a larger program, demonstrates how to use FreePropVariantArray

// PROPVARIANT rgpropvar[5];
// Assume all 5 propvariants are initialized and valid.

FreePropVariantArray(ARRAYSIZE(rgpropvar), rgpropvar);

Requirements

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