SHUnicodeToAnsiCPAlloc

Go to Home Page

Maps a narrow string to a wide string via a specific code page

Syntax

HRESULT WINAPI SHUnicodeToAnsiCPAlloc (
    UINT codePage,
    LPCWSTR pwszString,
    LPSTR* ppszConverted
)

Parameters

codePage
The codepage to use in the call to MultiByteToWideChar
pszString
The string to be narrowed
ppwszConverted
A pointer to a pointer that receives the narrowed string. The returned pointer must be freed with CoTaskMemFree when it is no longer needed.

Return Value

S_OK on success, E_OUTOFMEORY or HRESULT_FROM_WIN32(GetLastError()) on failure

Remarks

This function is also known as _SHUnicodeToAnsiCPAlloc@12.