PropVariantToFileTimeVectorAlloc function (propvarutil.h)

Extracts data from a PROPVARIANT structure into a newly-allocated FILETIME vector.

Syntax

PSSTDAPI PropVariantToFileTimeVectorAlloc(
  REFPROPVARIANT propvar,
  FILETIME       **pprgft,
  ULONG          *pcElem
);

Parameters

propvar

Type: REFPROPVARIANT

Reference to a source PROPVARIANT structure.

pprgft

Type: FILETIME**

When this function returns, contains a pointer to a vector of FILETIME values extracted from the source PROPVARIANT structure.

pcElem

Type: ULONG*

When this function returns, contains the count of FILETIME elements extracted from source PROPVARIANT structure.

Return value

Type: HRESULT

Returns one of the following values.

Return code Description
S_OK
Returns S_OK if successful, or an error value otherwise.
E_INVALIDARG
ThePROPVARIANTwas not of the appropriate type.

Remarks

This helper function is used in places where the calling application expects a PROPVARIANT to hold a FILETIME vector value.

If the source PROPVARIANT has type VT_VECTOR | VT_FILETIME, this function extracts a vector of FILETIMEs values into a newly allocated vector of FILETIME values. The calling application is responsible for using CoTaskMemFree to release the vector pointed to by pprgft when it is no longer needed.

The output FILETIMEs will use the same time zone as the source FILETIMEs.

Examples

The following example, to be included as part of a larger program, demonstrates how to use PropVariantToFileTimeVectorAlloc to access a FILETIME vector value in a PROPVARIANT.

// PROPVARIANT propvar;
// Assume the variable propvar is initialized and valid. 
// The application is expecting propvar to contain a vector of FILETIME values.
BOOL *prgTimes;
ULONG cTimes;
HRESULT hr = PropVariantToBooleanVectorAlloc(propvar, &prgTimes, &cTimes);
if (SUCCEEDED(hr))
{
     // prgTimes now points to a vector of cTimes file times.
     CoTaskMemFree(prgTimes);
}

Requirements

   
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header propvarutil.h
Library Propsys.lib
DLL Propsys.dll (version 6.0 or later)
Redistributable Windows Desktop Search (WDS) 3.0

See also

InitPropVariantFromFileTimeVector

PropVariantToFileTime

PropVariantToFileTimeVector