Use wxString::t_str() in calls to Windows API functions in wxMSW.
Use t_str() instead of wx_str() to make the code work correctly in UTF-8 build in which wx_str() returns a pointer to UTF-8 buffer while we need a wchar_t pointer for Windows. Closes #14371. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -715,7 +715,7 @@ void wxMenuItem::SetItemLabel(const wxString& txt)
|
||||
if ( isLaterThanWin95 )
|
||||
info.fMask |= MIIM_STRING;
|
||||
//else: MIIM_TYPE already specified
|
||||
info.dwTypeData = (LPTSTR)m_text.wx_str();
|
||||
info.dwTypeData = wxMSW_CONV_LPTSTR(m_text);
|
||||
info.cch = m_text.length();
|
||||
if ( !::SetMenuItemInfo(hMenu, id, FALSE, &info) )
|
||||
{
|
||||
@@ -975,7 +975,7 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
int x = rcText.left;
|
||||
int y = rcText.top + (rcText.bottom - rcText.top - textSize.cy) / 2;
|
||||
|
||||
::DrawState(hdc, NULL, NULL, (LPARAM)text.wx_str(),
|
||||
::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(text),
|
||||
text.length(), x, y, 0, 0, flags);
|
||||
|
||||
// ::SetTextAlign(hdc, TA_RIGHT) doesn't work with DSS_DISABLED or DSS_MONO
|
||||
@@ -1005,7 +1005,7 @@ bool wxMenuItem::OnDrawItem(wxDC& dc, const wxRect& rc,
|
||||
|
||||
int y = rcText.top + (rcText.bottom - rcText.top - accelSize.cy) / 2;
|
||||
|
||||
::DrawState(hdc, NULL, NULL, (LPARAM)accel.wx_str(),
|
||||
::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(accel),
|
||||
accel.length(), x, y, 0, 0, flags);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user