Fix wxTaskBarButton code compilation in ANSI mode.
Correctly declare SHStrDupW() as always producing a wide char string on output and pass a wide string to wxStrlcpy() using a wide char buffer. Closes #17033.
This commit is contained in:
@@ -326,7 +326,7 @@ inline HRESULT InitPropVariantFromString(PCWSTR psz, PROPVARIANT *ppropvar)
|
|||||||
ppropvar->vt = VT_LPWSTR;
|
ppropvar->vt = VT_LPWSTR;
|
||||||
|
|
||||||
#if wxUSE_DYNLIB_CLASS
|
#if wxUSE_DYNLIB_CLASS
|
||||||
typedef HRESULT (WINAPI *SHStrDupW_t)(LPCTSTR, LPTSTR*);
|
typedef HRESULT (WINAPI *SHStrDupW_t)(LPCWSTR, LPWSTR*);
|
||||||
static SHStrDupW_t s_pfnSHStrDupW = NULL;
|
static SHStrDupW_t s_pfnSHStrDupW = NULL;
|
||||||
if ( !s_pfnSHStrDupW )
|
if ( !s_pfnSHStrDupW )
|
||||||
{
|
{
|
||||||
@@ -939,7 +939,7 @@ bool wxTaskBarButtonImpl::InitOrUpdateThumbBarButtons()
|
|||||||
// Truncate the tooltip if its length longer than szTip(THUMBBUTTON)
|
// Truncate the tooltip if its length longer than szTip(THUMBBUTTON)
|
||||||
// allowed length (260).
|
// allowed length (260).
|
||||||
tooltip.Truncate(260);
|
tooltip.Truncate(260);
|
||||||
wxStrlcpy(buttons[i].szTip, tooltip.t_str(), tooltip.length());
|
wxStrlcpy(buttons[i].szTip, tooltip.wc_str(), tooltip.length());
|
||||||
buttons[i].dwMask =
|
buttons[i].dwMask =
|
||||||
static_cast<THUMBBUTTONMASK>(buttons[i].dwMask | THB_TOOLTIP);
|
static_cast<THUMBBUTTONMASK>(buttons[i].dwMask | THB_TOOLTIP);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user