EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

InitVariantFromStrRet function

Initializes a VARIANT structure with a string stored in a STRRET structure.

Syntax


HRESULT InitVariantFromStrRet(
  _In_   STRRET *pstrret,
  _In_   PCUITEMID_CHILD pidl,
  _Out_  VARIANT *pvar
);

Parameters

pstrret [in]

Type: STRRET*

Pointer to a STRRET structure.

pidl [in]

Type: PCUITEMID_CHILD

PIDL of the item whose details are being retrieved.

pvar [out]

Type: VARIANT*

When this function returns, contains the initialized VARIANT structure.

Return value

Type: HRESULT

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

Remarks

Creates a VT_BSTR variant.

Note  This function frees the resources used for the STRRET contents.

Examples

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


// STRRET strret;
// PCUITEMID_CHILD pidl;
// Assume variables strret and pidl are initialized and valid.
VARIANT var;

HRESULT hr = InitVariantFromStrRet(strret, pidl, &var);

if (SUCCEEDED(hr))
{
    // var now is valid and has type VT_BSTR.
    VariantClear(&var);
}

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

VariantToString
VariantToStringWithDefault
InitVariantFromString

 

 

Ajouts de la communauté

AJOUTER
Afficher:
© 2014 Microsoft