StrRetToBuf function

Converts an STRRET structure returned by IShellFolder::GetDisplayNameOf to a string, and places the result in a buffer.

Syntax


HRESULT StrRetToBuf(
  _Inout_  STRRET *pstr,
  _In_     PCUITEMID_CHILD pidl,
  _Out_    LPTSTR pszBuf,
  _In_     UINT cchBuf
);

Parameters

pstr [in, out]

Type: STRRET*

A pointer to the STRRET structure. When the function returns, this pointer will no longer be valid.

pidl [in]

Type: PCUITEMID_CHILD

A pointer to the item's ITEMIDLIST structure.

pszBuf [out]

Type: LPTSTR

A buffer to hold the display name. It will be returned as a null-terminated string. If cchBuf is too small, the name will be truncated to fit.

cchBuf [in]

Type: UINT

The size of pszBuf, in characters. If cchBuf is too small, the string will be truncated to fit.

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 structure pointed to by pstr is set to STRRET_WSTR, the pOleStr member of that structure will be freed on return.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 5.0 or later)

Unicode and ANSI names

StrRetToBufW (Unicode) and StrRetToBufA (ANSI)

See also

StrRetToStr
StrRetToStrN

 

 

Community Additions

ADD
Show:
© 2014 Microsoft