Expand Minimize

FreePropVariantArray function

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

Syntax


HRESULT FreePropVariantArray(
  _In_     ULONG cVariants,
  _Inout_  PROPVARIANT *rgvars
);

Parameters

cVariants [in]

Type: ULONG

The number of elements in the array specified by rgvars.

rgvars [in, out]

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

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 with SP1 [desktop apps only]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Propidl.h

Library

Ole32.lib

DLL

Ole32.dll (version 6.0 or later)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft