EN
Este contenido no se encuentra disponible en su idioma, pero aquí tiene la versión en inglés.

PropVariantToFileTimeVectorAlloc function

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

Syntax


HRESULT PropVariantToFileTimeVectorAlloc(
  _In_   REFPROPVARIANT propvar,
  _Out_  FILETIME **pprgft,
  _Out_  ULONG *pcElem
);

Parameters

propvar [in]

Type: REFPROPVARIANT

Reference to a source PROPVARIANT structure.

pprgft [out]

Type: FILETIME**

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

pcElem [out]

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 codeDescription
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]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Propvarutil.h

Library

Propsys.lib

DLL

Propsys.dll (version 6.0 or later)

See also

InitPropVariantFromFileTimeVector
PropVariantToFileTime
PropVariantToFileTimeVector

 

 

Adiciones de comunidad

AGREGAR
Mostrar:
© 2014 Microsoft