# PropVariantClear

Frees all elements that can be freed in a given PROPVARIANT structure.

HRESULT PropVariantClear(

PROPVARIANT* pvarg | //Pointer to a PROPVARIANT structure
); |

Parameters

pvarg
  [in] Pointer to an initialized PROPVARIANT structure for which any deallocatable elements are to be freed. On return, all zeroes are written to the PROPVARIANT.

Return Values

S_OK
  The VT types are recognized and all items that can be freed have been freed.
STG_E_INVALID_PARAMETER
  The variant has an unknown VT type.

Remarks

At any level of indirection, a NULL pointer is ignored. For example, in a VT_CF PROPVARIANT, the pvargpclipdatapClipData could be NULL. In this case, the pvargpclipdatapClipData pointer would be ignored, but the pvargpclipdata pointer would be freed.

On return, this function writes zeroes to the specified PROPVARIANT, so the VT-type is VT_EMPTY.

Passing NULL as the pvarg parameter produces a return code of S_OK.

See Also

FreePropVariantArray