PropVariantCopy

Copies the contents of a PROPVARIANT structure to another.

HRESULT PropVariantCopy(
  PROPVARIANT * pDest //Pointer to uninitialized PROPVARIANT that is 
                      // filled on return
  PROPVARIANT *pvarg  //PROPVARIANT to be copied
);
 

Parameters

pDest
[in, out] Pointer to an uninitialized PROPVARIANT structure that receives the copy.
pvarg
[in] Pointer to the PROPVARIANT to be copied.

Return Values

S_OK
The copy was successfully completed.
STG_E_INVALID_PARAMETER
The variant has an unknown type.

Remarks

Copies a PROPVARIANT by value so the original pvarg and new pDest may be freed independently with calls to PropVariantClear. For non-simple PROPVARIANT types such as VT_STREAM, VT_STORAGE, etc, which require a subobject, the copy is made by reference. The pointer is copied and AddRef is called on it. It is illegal to pass NULL for either pDest or pvarg.

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

PROPVARIANT, PropVariantClear