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 pvarg用clipdata用ClipData could be NULL. In this case, the pvarg用clipdata用ClipData pointer would be ignored, but the pvarg用clipdata 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.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in objidl.h.
  Import Library: Included as a resource in ole32.dll.

See Also

FreePropVariantArray