Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function copies the contents of one PROPVARIANTstructure to another.

Syntax

WINOLEAPI PropVariantCopy(
  PROPVARIANT*	 
pvarDest,
  const PROPVARIANT* 
pvarSrc
);

Parameters

pvarDest

[in, out] Pointer to an uninitialized PROPVARIANTstructure that receives the copy.

pvarSrc

[in] Pointer to the PROPVARIANTstructure to be copied.

Return Values

The following table shows the return values for this function.

Value Description

S_OK

The copy was successfully completed.

STG_E_INVALID_PARAMETER

The variant has an unknown type.

Remarks

Copies a PROPVARIANTstructure by value so the original pvarSrcand new pvarDestparameters may be freed independently with calls to PropVariantClear. PropVariantCopydoes not free the destination as the VariantCopyfunction does. For nonsimple PROPVARIANTtypes such as VT_STREAM, VT_STORAGE, and so forth, which require a subobject, the copy is made by reference. The pointer is copied and IUnknown::AddRefis called on it. It is illegal to pass NULL for either pvarDestor pvarSrc.

Requirements

Header oaidl.h
Library oleaut32.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also