EN
此内容没有您的语言版本,但有英语版本。

PropVariantGetFileTimeElem function

Extracts a single FILETIME element from a PROPVARIANT structure of type VT_FILETIME, VT_VECTOR | VT_FILETIME, or VT_ARRAY | VT_FILETIME.

Syntax


HRESULT PropVariantGetFileTimeElem(
  _In_   REFPROPVARIANT propvar,
  _In_   ULONG iElem,
  _Out_  FILETIME *pftVal
);

Parameters

propvar [in]

Type: REFPROPVARIANT

The source PROPVARIANT structure.

iElem [in]

Type: ULONG

Specifies vector or array index; otherwise, this value must be 0.

pftVal [out]

Type: FILETIME*

When this function returns, contains the extracted filetime value.

Return value

Type: HRESULT

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

Remarks

If the source PROPVARIANT has type VT_FILETIME, iElem must be 0; otherwise, iElem must be less than the number of elements in the vector or array. You can use PropVariantGetElementCount to obtain the number of elements in the vector or array.

Examples

The following code example, to be included as part of a larger program, demonstrates how to use PropVariantGetFileTimeElem in an iteration statement to access the values in PROPVARIANT.


// PROPVARIANT propvar;
// Assume propvar is initialized and valid;

if ((propvar.vt & VT_TYPEMASK) == VT_FILETIME)
{
    UINT cElem = PropVariantGetElementCount(propvar);
    HRESULT hr = <mark type="const">S_OK</mark>;

    for (UINT iElem = 0; SUCCEEDED(hr) && iElem < cElem; iElem ++)
    {
        FILETIME ftValue;
        hr = PropVariantGetFileTimeElem(propvar, iElem, &ftValue);

        if (SUCCEEDED(hr))
        {
            // ftValue is valid now
        }
    }
}

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

PropVariantGetElem

 

 

社区附加资源

添加
显示:
© 2014 Microsoft