Fix wxMSW build in non-Unicode mode

Convert WCHAR to TCHAR explicitly in this case.

Closes #18320.
This commit is contained in:
Vadim Zeitlin
2019-01-05 00:01:09 +01:00
parent 3cfec773c9
commit 1d72f6af7e

View File

@@ -137,6 +137,21 @@ MSWGetBitmapFromIconLocation(const TCHAR* path, int index, const wxSize& size)
return wxBitmap(icon);
}
#if !wxUSE_UNICODE
// SHSTOCKICONINFO always uses WCHAR, even in ANSI build, so we need to convert
// it to TCHAR, which is just CHAR in this case, used by the other functions.
// Provide an overload doing it as this keeps the code in the main function
// clean and this entire block (inside !wxUSE_UNICODE check) can be just
// removed when support for ANSI build is finally dropped.
wxBitmap
MSWGetBitmapFromIconLocation(const WCHAR* path, int index, const wxSize& size)
{
return MSWGetBitmapFromIconLocation(wxString(path).mb_str(), index, size);
}
#endif // !wxUSE_UNICODE
wxBitmap
MSWGetBitmapForPath(const wxString& path, const wxSize& size, DWORD uFlags = 0)
{