StrRetToBSTR function

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(
  STRRET          *pstr,
  PCUITEMID_CHILD pidl,
  BSTR            *pbstr
);

Parameters

pstr

Type: STRRET*

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

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.

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

   
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