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:
Vadim Zeitlin
2012-06-03 19:16:59 +00:00
parent f40f8e1722
commit 017dc06b50
58 changed files with 164 additions and 164 deletions

View File

@@ -397,7 +397,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd)
// NMTTDISPINFO struct -- and setting the tooltip here we can have tooltips
// of any length
ti.hwnd = hwnd;
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
ti.lpszText = wxMSW_CONV_LPTSTR(m_text);
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
{
@@ -442,7 +442,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd)
const wxString token = tokenizer.GetNextToken();
SIZE sz;
if ( !::GetTextExtentPoint32(hdc, token.wx_str(),
if ( !::GetTextExtentPoint32(hdc, token.t_str(),
token.length(), &sz) )
{
wxLogLastError(wxT("GetTextExtentPoint32"));
@@ -484,7 +484,7 @@ void wxToolTip::DoAddHWND(WXHWND hWnd)
// replace the '\n's with spaces because otherwise they appear as
// unprintable characters in the tooltip string
m_text.Replace(wxT("\n"), wxT(" "));
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
ti.lpszText = wxMSW_CONV_LPTSTR(m_text);
if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) )
{
@@ -561,7 +561,7 @@ void wxToolTip::DoSetTip(WXHWND hWnd)
ti.lpszText = const_cast<wxChar *>(wxT(""));
(void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);
ti.lpszText = const_cast<wxChar *>(m_text.wx_str());
ti.lpszText = wxMSW_CONV_LPTSTR(m_text);
(void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti);
}