PropVariantToVariant function

Converts the contents of a PROPVARIANT structure to a VARIANT structure.

Syntax


HRESULT PropVariantToVariant(
  _In_  const PROPVARIANT *pPropVar,
  _Out_       VARIANT     *pVar
);

Parameters

pPropVar [in]

Type: const PROPVARIANT*

Pointer to a source PROPVARIANT structure.

pVar [out]

Type: VARIANT*

Pointer to a VARIANT structure. When this function returns, the VARIANT contains the converted information.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Normally, the data stored in the PROPVARIANT is copied to the VARIANT without a datatype change. However, in the following cases, there is no direct VARIANT support for the datatype, and they are converted as shown.

Original PROPVARIANT TypeStored as VARIANT Type
VT_BLOB, VT_STREAMVT_UNKNOWN. The punkVal member will contain a pointer to an IStream that contains the source data.
VT_LPSTR, VT_LPWSTR, VT_CLSIDVT_BSTR
VT_FILETIMEVT_DATE
VT_VECTOR|xVT_ARRAY|y

 

The following types cannot be converted with this function.

  • VT_STORAGE
  • VT_BLOB_OBJECT
  • VT_STREAMED_OBJECT
  • VT_STORED_OBJECT
  • VT_CF
  • VT_VECTOR | VT_CF

Requirements

Minimum supported client

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

Minimum supported server

Windows Server 2003 with SP1 [desktop apps only]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Propvarutil.h

Library

Propsys.lib

DLL

Propsys.dll (version 6.0 or later)

 

 

Show: