StrRetToBSTR function (shlwapi.h)

Accepts a STRRET structure returned by IShellFolder::GetDisplayNameOf that contains or points to a string, and returns that string as a BSTR.

Syntax

LWSTDAPI StrRetToBSTR(
  [in, out] STRRET          *pstr,
  [in]      PCUITEMID_CHILD pidl,
  [out]     BSTR            *pbstr
);

Parameters

[in, out] pstr

Type: STRRET*

A pointer to a STRRET structure. When the function returns, this pointer is longer valid.

[in] pidl

Type: PCUITEMID_CHILD

A pointer to an ITEMIDLIST that uniquely identifies a file object or subfolder relative to the parent folder. This value can be NULL.

[out] pbstr

Type: BSTR*

A pointer to a variable of type BSTR that receives the converted string.

Return value

Type: HRESULT

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

Remarks

If the uType member of the STRRET structure pointed to by pstr is set to STRRET_WSTR, the pOleStr member of that structure is freed on return.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 5.5 or later)

See also

IShellFolder::GetDisplayNameOf

StrRetToBuf

StrRetToStr