EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

PropVariantGetUInt64Elem function

Extracts a single unsigned Int64 element from a PROPVARIANT structure of type VT_UI8, VT_VECTOR | VT_UI8, or VT_ARRAY | VT_UI8.

Syntax


HRESULT PropVariantGetUInt64Elem(
  _In_   REFPROPVARIANT propvar,
  _In_   ULONG iElem,
  _Out_  ULONGLONG *pnVal
);

Parameters

propvar [in]

Type: REFPROPVARIANT

The source PROPVARIANT structure.

iElem [in]

Type: ULONG

The vector or array index; otherwise, iElem must be 0.

pnVal [out]

Type: ULONGLONG*

When this function returns, contains the extracted Int64 value.

Return value

Type: HRESULT

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

Remarks

This helper function works for PROPVARIANT structures of the following types:

  • VT_UI8
  • VT_VECTOR | VT_UI8
  • VT_ARRAY | VT_UI8

If the source PROPVARIANT has type VT_UI8, 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 example, to be included as part of a larger program, demonstrates how to use PropVariantGetUInt64Elem with an iteration statement to access the values in a PROPVARIANT.


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

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

    for (UINT iElem = 0; SUCCEEDED(hr) && iElem < cElem; iElem ++)
    {
        ULONGLONG nValue;
        hr = PropVariantGetUInt64Elem(propvar, iElem, &nValue);

        if (SUCCEEDED(hr))
        {
            // nValue 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

 

 

Community-Beiträge

HINZUFÜGEN
Anzeigen:
© 2014 Microsoft