X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5e0b09554d03e088c4a4e3729f2fbcac35ca91d9..ccc040255c07064f2ed96f1a345d21860b202cb6:/src/msw/tooltip.cpp diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 23ad01cbd4..349998f1d5 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -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(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(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(wxT("")); (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti); - ti.lpszText = const_cast(m_text.wx_str()); + ti.lpszText = wxMSW_CONV_LPTSTR(m_text); (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti); }