StrRetToBufW function (shlwapi.h)
Converts an STRRET structure returned by IShellFolder::GetDisplayNameOf to a string, and places the result in a buffer.
Syntax
LWSTDAPI StrRetToBufW(
[in, out] STRRET *pstr,
[in] PCUITEMID_CHILD pidl,
[out] LPWSTR pszBuf,
[in] UINT cchBuf
);
Parameters
[in, out] pstr
Type: STRRET*
A pointer to the STRRET structure. When the function returns, this pointer will no longer be valid.
[in] pidl
Type: PCUITEMID_CHILD
A pointer to the item's ITEMIDLIST structure.
[out] pszBuf
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.
[in] cchBuf
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.
Note
The shlwapi.h header defines StrRetToBuf as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional, Windows XP [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | shlwapi.h |
Library | Shlwapi.lib |
DLL | Shlwapi.dll (version 5.0 or later) |