EN
Il contenuto non è disponibile nella lingua di destinazione, ma solo in inglese.

InitPropVariantFromStringVector function

Initializes a PROPVARIANT structure from a specified string vector.

Syntax


HRESULT InitPropVariantFromStringVector(
  _In_   PCWSTR *prgsz,
  _In_   ULONG cElems,
  _Out_  PROPVARIANT *ppropvar
);

Parameters

prgsz [in]

Type: PCWSTR*

Pointer to a buffer that contains the source string vector.

cElems [in]

Type: ULONG

The number of vector elements in prgsz.

ppropvar [out]

Type: PROPVARIANT*

When this function returns, contains the initialized PROPVARIANT structure.

Return value

Type: HRESULT

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

Examples

The following example, to be included as part of a larger program, demonstrates how to use InitPropVariantFromStringVector.


PCWSTR rgStrings[] = {"dog", "cat"};
PROPVARIANT propvar;
HRESULT hr = InitPropVariantFromStringVector(rgStrings, ARRAYSIZE(rgStrings), &propvar);

if (SUCCEEDED(hr))
{
    // propvar now is valid and has type VT_VECTOR | VT_LPWSTR.
    PropVariantClear(&propvar);
}

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

PropVariantToStringVector
InitPropVariantFromString
InitPropVariantFromStringAsVector
InitVariantFromString

 

 

Aggiunte alla community

AGGIUNGI
Mostra:
© 2014 Microsoft