Skip to content

Latest commit

 

History

History
176 lines (130 loc) · 5.53 KB

nf-propvarutil-propvarianttouint64vector.md

File metadata and controls

176 lines (130 loc) · 5.53 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:propvarutil.PropVariantToUInt64Vector
PropVariantToUInt64Vector function (propvarutil.h)
Extracts data from a PROPVARIANT structure into a ULONGLONG vector.
PropVariantToUInt64Vector
PropVariantToUInt64Vector function [Windows Properties]
_shell_PropVariantToUInt64Vector
properties.PropVariantToUInt64Vector
propvarutil/PropVariantToUInt64Vector
shell.PropVariantToUInt64Vector
properties\PropVariantToUInt64Vector.htm
properties
596c7a35-6645-4f66-b924-b71278778776
12/05/2018
PropVariantToUInt64Vector, PropVariantToUInt64Vector function [Windows Properties], _shell_PropVariantToUInt64Vector, properties.PropVariantToUInt64Vector, propvarutil/PropVariantToUInt64Vector, shell.PropVariantToUInt64Vector
propvarutil.h
Windows
Windows XP with SP2, Windows Vista [desktop apps only]
Windows Server 2003 with SP1 [desktop apps only]
Propsys.lib
Propsys.dll (version 6.0 or later)
Windows
Windows Desktop Search (WDS) 3.0
19H1
PropVariantToUInt64Vector
propvarutil/PropVariantToUInt64Vector
c++
APIRef
kbSyntax
DllExport
Propsys.dll
PropVariantToUInt64Vector

PropVariantToUInt64Vector function

-description

Extracts data from a PROPVARIANT structure into a ULONGLONG vector.

-parameters

-param propvar [in]

Type: REFPROPVARIANT

Reference to a source PROPVARIANT structure.

-param prgn [out]

Type: ULONGLONG*

Points to a buffer containing crgn   ULONGLONG values. When this function returns, the buffer has been initialized with pcElem   ULONGLONG elements extracted from the source PROPVARIANT.

-param crgn [in]

Type: ULONG

Size of the buffer pointed to by prgn, in elements.

-param pcElem [out]

Type: ULONG*

When this function returns, contains the count of ULONGLONG values extracted from the source PROPVARIANT structure.

-returns

Type: HRESULT

This function can return one of these values.

Return code Description
S_OK
Returns S_OK if successful, or an error value otherwise.
TYPE_E_BUFFERTOOSMALL
The source PROPVARIANT contained more than crgn values. The buffer pointed to by prgn.
E_INVALIDARG
The PROPVARIANT was not of the appropriate type.

-remarks

This helper function is used in places where the calling application expects a PROPVARIANT to hold a vector of ULONGLONG values with a fixed number of elements.

If the source PROPVARIANT has type VT_VECTOR | VT_UI8 or VT_ARRAY | VT_UI8, this helper function extracts up to crgn   ULONGLONG values and places them into the buffer pointed to by prgn. If the PROPVARIANT contains more elements than will fit into the prgn buffer, this function returns an error and sets pcElem to 0.

Examples

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

// PROPVARIANT propvar;
// Assume the variable propvar is initialized and valid
ULONGLONG rgLongs[4]; // The application is expecting propvar to hold 4 ULONGLONGs in a vector
ULONG cElems;
HRESULT hr = PropVariantToUInt64Vector(propvar, rgLongs, ARRAYSIZE(rgLongs), &cElems);
if (SUCCEEDED(hr))
{
     if (cElems == ARRAYSIZE(rgLongs))
     {
         // The application got 4 ULONGLONGs which are now stored in rgLongs
     }
     else
     {
         // The application got cElems which are stored in the first cElems elements of rgLongs
     }
}

-see-also

InitPropVariantFromUInt64Vector

PropVariantGetUInt64Elem

PropVariantToUInt64

PropVariantToUInt64VectorAlloc

VariantToUInt64Array