From 017dc06b502c041c112a3948e6c5f65000a86d94 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Jun 2012 19:16:59 +0000 Subject: [PATCH] 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 --- docs/changes.txt | 2 +- include/wx/msw/helpchm.h | 2 +- include/wx/msw/private.h | 2 +- src/msw/accel.cpp | 2 +- src/msw/anybutton.cpp | 6 ++--- src/msw/app.cpp | 8 +++---- src/msw/calctrl.cpp | 2 +- src/msw/checkbox.cpp | 4 ++-- src/msw/choice.cpp | 4 ++-- src/msw/colordlg.cpp | 2 +- src/msw/combobox.cpp | 2 +- src/msw/commandlinkbutton.cpp | 2 +- src/msw/control.cpp | 6 ++--- src/msw/dc.cpp | 2 +- src/msw/dcprint.cpp | 10 ++++----- src/msw/dirdlg.cpp | 4 ++-- src/msw/display.cpp | 2 +- src/msw/enhmeta.cpp | 4 ++-- src/msw/fdrepdlg.cpp | 2 +- src/msw/filedlg.cpp | 8 +++---- src/msw/fontenum.cpp | 2 +- src/msw/gdiimage.cpp | 12 +++++----- src/msw/headerctrl.cpp | 2 +- src/msw/helpchm.cpp | 6 ++--- src/msw/helpwin.cpp | 10 ++++----- src/msw/iniconf.cpp | 42 +++++++++++++++++------------------ src/msw/listbox.cpp | 4 ++-- src/msw/listctrl.cpp | 6 ++--- src/msw/main.cpp | 2 +- src/msw/mdi.cpp | 10 ++++----- src/msw/menu.cpp | 28 +++++++++++------------ src/msw/menuitem.cpp | 6 ++--- src/msw/metafile.cpp | 2 +- src/msw/msgdlg.cpp | 16 ++++++------- src/msw/notebook.cpp | 4 ++-- src/msw/ole/dataobj.cpp | 4 ++-- src/msw/ownerdrw.cpp | 2 +- src/msw/printdlg.cpp | 8 +++---- src/msw/progdlg.cpp | 12 +++++----- src/msw/radiobox.cpp | 2 +- src/msw/registry.cpp | 2 +- src/msw/richmsgdlg.cpp | 4 ++-- src/msw/slider.cpp | 6 ++--- src/msw/spinctrl.cpp | 2 +- src/msw/statbox.cpp | 4 ++-- src/msw/statusbar.cpp | 4 ++-- src/msw/taskbar.cpp | 6 ++--- src/msw/textctrl.cpp | 4 ++-- src/msw/textentry.cpp | 2 +- src/msw/toolbar.cpp | 2 +- src/msw/tooltip.cpp | 8 +++---- src/msw/toplevel.cpp | 4 ++-- src/msw/treectrl.cpp | 6 ++--- src/msw/utils.cpp | 2 +- src/msw/utilsgui.cpp | 2 +- src/msw/volume.cpp | 2 +- src/msw/wince/tbarwce.cpp | 2 +- src/msw/window.cpp | 10 ++++----- 58 files changed, 164 insertions(+), 164 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 01526ba6a9..25de3d2404 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -587,7 +587,7 @@ MSW: - Fix handling of composite windows in wxToolTip (Armel Asselin). - Add VT_I8 support to wxAutomationObject (PB). - Fix wxListbook size calculations to avoid spurious scrollbars. -- Fix non-GUI code compilation with wxUSE_UNICODE_UTF8 (Kolya Kosenko). +- Fix code compilation with wxUSE_UNICODE_UTF8 (Kolya Kosenko). OSX: diff --git a/include/wx/msw/helpchm.h b/include/wx/msw/helpchm.h index 13d062de38..8d139155b0 100644 --- a/include/wx/msw/helpchm.h +++ b/include/wx/msw/helpchm.h @@ -63,7 +63,7 @@ protected: // the first 2 HtmlHelp() parameters bool CallHtmlHelp(unsigned cmd, WXWPARAM param) { - return CallHtmlHelp(GetParentWindow(), GetValidFilename().wx_str(), + return CallHtmlHelp(GetParentWindow(), GetValidFilename().t_str(), cmd, param); } diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 959898fe4c..6c10cfa60d 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -796,7 +796,7 @@ public: { if ( IsRegistered() ) { - if ( !::UnregisterClass(m_clsname.wx_str(), wxGetInstance()) ) + if ( !::UnregisterClass(m_clsname.t_str(), wxGetInstance()) ) { wxLogLastError(wxT("UnregisterClass")); } diff --git a/src/msw/accel.cpp b/src/msw/accel.cpp index 434df30367..1dc9e4efc8 100644 --- a/src/msw/accel.cpp +++ b/src/msw/accel.cpp @@ -89,7 +89,7 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource) { m_refData = new wxAcceleratorRefData; - HACCEL hAccel = ::LoadAccelerators(wxGetInstance(), resource.wx_str()); + HACCEL hAccel = ::LoadAccelerators(wxGetInstance(), resource.t_str()); M_ACCELDATA->m_hAccel = hAccel; M_ACCELDATA->m_ok = hAccel != 0; } diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index 03a9d7039f..6e4438b371 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -813,7 +813,7 @@ void DrawButtonText(HDC hdc, // first we need to compute its bounding rect RECT rc; ::CopyRect(&rc, pRect); - ::DrawText(hdc, text.wx_str(), text.length(), &rc, + ::DrawText(hdc, text.t_str(), text.length(), &rc, DT_CENTER | DT_CALCRECT); // now center this rect inside the entire button area @@ -824,7 +824,7 @@ void DrawButtonText(HDC hdc, rc.top = pRect->top + (pRect->bottom - pRect->top)/2 - h/2; rc.bottom = rc.top+h; - ::DrawText(hdc, text.wx_str(), text.length(), &rc, flags); + ::DrawText(hdc, text.t_str(), text.length(), &rc, flags); } else // single line label { @@ -851,7 +851,7 @@ void DrawButtonText(HDC hdc, // notice that we must have DT_SINGLELINE for vertical alignment flags // to work - ::DrawText(hdc, text.wx_str(), text.length(), pRect, + ::DrawText(hdc, text.t_str(), text.length(), pRect, flags | DT_SINGLELINE ); } } diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 8df236020f..98491b4bc2 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -557,7 +557,7 @@ bool wxConsoleStderr::Write(const wxString& text) return false; } - if ( !::WriteConsole(m_hStderr, text.wx_str(), text.length(), &ret, NULL) ) + if ( !::WriteConsole(m_hStderr, text.t_str(), text.length(), &ret, NULL) ) { wxLogLastError(wxT("WriteConsole")); return false; @@ -692,7 +692,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name, ClassRegInfo regClass(name); - wndclass.lpszClassName = regClass.regname.wx_str(); + wndclass.lpszClassName = regClass.regname.t_str(); if ( !::RegisterClass(&wndclass) ) { wxLogLastError(wxString::Format(wxT("RegisterClass(%s)"), @@ -701,7 +701,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name, } wndclass.style &= ~(CS_HREDRAW | CS_VREDRAW); - wndclass.lpszClassName = regClass.regnameNR.wx_str(); + wndclass.lpszClassName = regClass.regnameNR.t_str(); if ( !::RegisterClass(&wndclass) ) { wxLogLastError(wxString::Format(wxT("RegisterClass(%s)"), @@ -716,7 +716,7 @@ const wxChar *wxApp::GetRegisteredClassName(const wxChar *name, // function returns (it could be invalidated later if new elements are // added to the vector and it's reallocated but this shouldn't matter as // this pointer should be used right now, not stored) - return gs_regClassesInfo.back().regname.wx_str(); + return gs_regClassesInfo.back().regname.t_str(); } bool wxApp::IsRegisteredClassName(const wxString& name) diff --git a/src/msw/calctrl.cpp b/src/msw/calctrl.cpp index 467ced1e8c..7d80380b93 100644 --- a/src/msw/calctrl.cpp +++ b/src/msw/calctrl.cpp @@ -109,7 +109,7 @@ wxCalendarCtrl::Create(wxWindow *parent, } const wxChar * const clsname = s_clsMonthCal.IsRegistered() - ? s_clsMonthCal.GetName().wx_str() + ? s_clsMonthCal.GetName().t_str() : MONTHCAL_CLASS; if ( !MSWCreateControl(clsname, wxEmptyString, pos, size) ) diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index 9e0aeede7f..fed760a4a5 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -447,7 +447,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) // around it if ( isFocused ) { - if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel, + if ( !::DrawText(hdc, label.t_str(), label.length(), &rectLabel, fmt | DT_CALCRECT) ) { wxLogLastError(wxT("DrawText(DT_CALCRECT)")); @@ -459,7 +459,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) ::SetTextColor(hdc, ::GetSysColor(COLOR_GRAYTEXT)); } - if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel, fmt) ) + if ( !::DrawText(hdc, label.t_str(), label.length(), &rectLabel, fmt) ) { wxLogLastError(wxT("DrawText()")); } diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 0c0dbc10c7..ea922c9e41 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -333,7 +333,7 @@ int wxChoice::FindString(const wxString& s, bool bCase) const else { int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT, - (WPARAM)-1, (LPARAM)s.wx_str()); + (WPARAM)-1, wxMSW_CONV_LPARAM(s)); return pos == LB_ERR ? wxNOT_FOUND : pos; } @@ -360,7 +360,7 @@ void wxChoice::SetString(unsigned int n, const wxString& s) const bool wasSelected = static_cast(n) == GetSelection(); ::SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); - ::SendMessage(GetHwnd(), CB_INSERTSTRING, n, (LPARAM)s.wx_str() ); + ::SendMessage(GetHwnd(), CB_INSERTSTRING, n, wxMSW_CONV_LPARAM(s) ); // restore the client data if ( oldData ) diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp index 788f0fae7c..d3a8eaf655 100644 --- a/src/msw/colordlg.cpp +++ b/src/msw/colordlg.cpp @@ -79,7 +79,7 @@ wxColourDialogHookProc(HWND hwnd, const wxString title = dialog->GetTitle(); if ( !title.empty() ) - ::SetWindowText(hwnd, title.wx_str()); + ::SetWindowText(hwnd, title.t_str()); dialog->MSWOnInitDone((WXHWND)hwnd); } diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 9e3f75edd7..beb740ac71 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -308,7 +308,7 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id) // this string is going to become the new combobox value soon but // we need it to be done right now, otherwise the event handler // could get a wrong value when it calls our GetValue() - ::SetWindowText(GetHwnd(), value.wx_str()); + ::SetWindowText(GetHwnd(), value.t_str()); { wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_SELECTED, GetId()); diff --git a/src/msw/commandlinkbutton.cpp b/src/msw/commandlinkbutton.cpp index 796251439a..6a581ce518 100644 --- a/src/msw/commandlinkbutton.cpp +++ b/src/msw/commandlinkbutton.cpp @@ -92,7 +92,7 @@ wxCommandLinkButton::SetMainLabelAndNote(const wxString& mainLabel, if ( HasNativeCommandLinkButton() ) { wxButton::SetLabel(mainLabel); - ::SendMessage(m_hWnd, BCM_SETNOTE, 0, (LPARAM) note.wx_str()); + ::SendMessage(m_hWnd, BCM_SETNOTE, 0, wxMSW_CONV_LPARAM(note)); // Preserve the user-specified label for GetLabel() m_labelOrig = mainLabel; diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 0d937c9016..19151d7854 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -132,7 +132,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname, ( exstyle, // extended style classname, // the kind of control to create - label.wx_str(), // the window name + label.t_str(), // the window name style, // the window style x, y, w, h, // the window position and size GetHwndOf(GetParent()), // parent @@ -163,7 +163,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname, // Notice that 0xffff is not a valid Unicode character so the problem // doesn't arise in Unicode build. if ( !label.empty() && label[0] == -1 ) - ::SetWindowText(GetHwnd(), label.wx_str()); + ::SetWindowText(GetHwnd(), label.t_str()); #endif // !wxUSE_UNICODE // saving the label in m_labelOrig to return it verbatim @@ -453,7 +453,7 @@ int wxControlWithItems::MSWInsertOrAppendItem(unsigned pos, unsigned wm) { LRESULT n = SendMessage((HWND)MSWGetItemsHWND(), wm, pos, - (LPARAM)item.wx_str()); + wxMSW_CONV_LPARAM(item)); if ( n == CB_ERR || n == CB_ERRSPACE ) { wxLogLastError(wxT("SendMessage(XX_ADD/INSERTSTRING)")); diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index c7f3cfa665..077d9594ce 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1871,7 +1871,7 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y SIZE sizeRect; const size_t len = string.length(); - if ( !::GetTextExtentPoint32(GetHdc(), string.wx_str(), len, &sizeRect) ) + if ( !::GetTextExtentPoint32(GetHdc(), string.t_str(), len, &sizeRect) ) { wxLogLastError(wxT("GetTextExtentPoint32()")); } diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 150232ed19..ec8bc89aa8 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -118,8 +118,8 @@ wxPrinterDC::wxPrinterDC(const wxString& driver_name, { if ( !driver_name.empty() && !device_name.empty() && !file.empty() ) { - m_hDC = (WXHDC) CreateDC(driver_name.wx_str(), - device_name.wx_str(), + m_hDC = (WXHDC) CreateDC(driver_name.t_str(), + device_name.t_str(), file.fn_str(), NULL); } @@ -186,14 +186,14 @@ bool wxPrinterDCImpl::StartDoc(const wxString& message) { DOCINFO docinfo; docinfo.cbSize = sizeof(DOCINFO); - docinfo.lpszDocName = message.wx_str(); + docinfo.lpszDocName = message.t_str(); wxString filename(m_printData.GetFilename()); if (filename.empty()) docinfo.lpszOutput = NULL; else - docinfo.lpszOutput = filename.wx_str(); + docinfo.lpszOutput = filename.t_str(); docinfo.lpszDatatype = NULL; docinfo.fwType = 0; @@ -335,7 +335,7 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) HDC hDC = ::CreateDC ( NULL, // no driver name as we use device name - deviceName.wx_str(), + deviceName.t_str(), NULL, // unused static_cast(lockDevMode.Get()) ); diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index d17cdc7f0f..7b29069c55 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -263,7 +263,7 @@ int wxDirDialog::ShowSHBrowseForFolder(WXHWND owner) #endif bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT; bi.lpfn = BrowseCallbackProc; - bi.lParam = (LPARAM)m_path.wx_str(); // param for the callback + bi.lParam = wxMSW_CONV_LPARAM(m_path); // param for the callback static const int verComCtl32 = wxApp::GetComCtl32Version(); @@ -490,7 +490,7 @@ BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData) } SendMessage(hwnd, BFFM_SETSTATUSTEXT, - 0, (LPARAM)strDir.wx_str()); + 0, wxMSW_CONV_LPARAM(strDir)); } } break; diff --git a/src/msw/display.cpp b/src/msw/display.cpp index ebe394b0d7..f9f6b15102 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -431,7 +431,7 @@ bool wxDisplayMSW::ChangeMode(const wxVideoMode& mode) // do change the mode switch ( pfnChangeDisplaySettingsEx ( - GetName().wx_str(), // display name + GetName().t_str(), // display name pDevMode, // dev mode or NULL to reset NULL, // reserved flags, diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index 5249f46ff4..86e334507a 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -59,7 +59,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxEnhMetaFile, wxObject) // we must pass NULL if the string is empty to metafile functions static inline const wxChar *GetMetaFileName(const wxString& fn) - { return !fn ? (const wxChar *)NULL : (const wxChar*)fn.wx_str(); } + { return !fn ? NULL : wxMSW_CONV_LPCTSTR(fn); } // ============================================================================ // implementation @@ -291,7 +291,7 @@ void wxEnhMetaFileDCImpl::Create(HDC hdcRef, } m_hDC = (WXHDC)::CreateEnhMetaFile(hdcRef, GetMetaFileName(filename), - pRect, description.wx_str()); + pRect, description.t_str()); if ( !m_hDC ) { wxLogLastError(wxT("CreateEnhMetaFile")); diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index 3964c6a4bf..d185b884c3 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -310,7 +310,7 @@ wxFindReplaceDialogHookProc(HWND hwnd, FINDREPLACE *pFR = (FINDREPLACE *)lParam; wxFindReplaceDialog *dialog = (wxFindReplaceDialog *)pFR->lCustData; - ::SetWindowText(hwnd, dialog->GetTitle().wx_str()); + ::SetWindowText(hwnd, dialog->GetTitle().t_str()); // don't return FALSE from here or the dialog won't be shown return TRUE; diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 4fa0e56e75..99f73218ac 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -507,7 +507,7 @@ int wxFileDialog::ShowModal() of.lStructSize = gs_ofStructSize; of.hwndOwner = hWnd; - of.lpstrTitle = m_message.wx_str(); + of.lpstrTitle = m_message.t_str(); of.lpstrFileTitle = titleBuffer; of.nMaxFileTitle = wxMAXFILE + 1 + wxMAXEXT; @@ -609,7 +609,7 @@ int wxFileDialog::ShowModal() } } - of.lpstrFilter = (LPTSTR)filterBuffer.wx_str(); + of.lpstrFilter = filterBuffer.t_str(); of.nFilterIndex = m_filterIndex + 1; //=== Setting defaultFileName >>========================================= @@ -626,7 +626,7 @@ int wxFileDialog::ShowModal() wxString defextBuffer; // we need it to be alive until GetSaveFileName()! if (HasFdFlag(wxFD_SAVE)) { - const wxChar* extension = filterBuffer.wx_str(); + const wxChar* extension = filterBuffer.t_str(); int maxFilter = (int)(of.nFilterIndex*2L) - 1; for( int i = 0; i < maxFilter; i++ ) // get extension @@ -708,7 +708,7 @@ int wxFileDialog::ShowModal() (of.nFileExtension && fileNameBuffer[of.nFileExtension] == wxT('\0')) ) { // User has typed a filename without an extension: - const wxChar* extension = filterBuffer.wx_str(); + const wxChar* extension = filterBuffer.t_str(); int maxFilter = (int)(of.nFilterIndex*2L) - 1; for( int i = 0; i < maxFilter; i++ ) // get extension diff --git a/src/msw/fontenum.cpp b/src/msw/fontenum.cpp index 3c936a11fe..7ebc115010 100644 --- a/src/msw/fontenum.cpp +++ b/src/msw/fontenum.cpp @@ -160,7 +160,7 @@ void wxFontEnumeratorHelper::DoEnumerate() #ifdef __WXWINCE__ ::EnumFontFamilies(hDC, - m_facename.empty() ? NULL : m_facename.wx_str(), + m_facename.empty() ? NULL : wxMSW_CONV_LPCTSTR(m_facename), (wxFONTENUMPROC)wxFontEnumeratorProc, (LPARAM)this) ; #else // __WIN32__ diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index 818b18f7bf..1c4e5755ed 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -323,7 +323,7 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, int WXUNUSED(desiredHeight)) { // TODO: load colourmap. - bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.wx_str())); + bitmap->SetHBITMAP((WXHBITMAP)::LoadBitmap(wxGetInstance(), name.t_str())); if ( !bitmap->IsOk() ) { @@ -438,7 +438,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, desiredHeight == ::GetSystemMetrics(SM_CYICON) ) { // get the specified large icon from file - if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, &hicon, NULL, 1) ) + if ( !::ExtractIconEx(nameReal.t_str(), iconIndex, &hicon, NULL, 1) ) { // it is not an error, but it might still be useful to be informed // about it optionally @@ -451,7 +451,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, desiredHeight == ::GetSystemMetrics(SM_CYSMICON) ) { // get the specified small icon from file - if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, NULL, &hicon, 1) ) + if ( !::ExtractIconEx(nameReal.t_str(), iconIndex, NULL, &hicon, 1) ) { wxLogTrace(wxT("iconload"), wxT("No small icons found in the file '%s'."), @@ -464,7 +464,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, if ( !hicon ) { // take any size icon from the file by index - hicon = ::ExtractIcon(wxGetInstance(), nameReal.wx_str(), iconIndex); + hicon = ::ExtractIcon(wxGetInstance(), nameReal.t_str(), iconIndex); } #endif @@ -518,13 +518,13 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, // some icon rescaling internally which results in very ugly 16x16 icons if ( hasSize ) { - hicon = (HICON)::LoadImage(wxGetInstance(), name.wx_str(), IMAGE_ICON, + hicon = (HICON)::LoadImage(wxGetInstance(), name.t_str(), IMAGE_ICON, desiredWidth, desiredHeight, LR_DEFAULTCOLOR); } else { - hicon = ::LoadIcon(wxGetInstance(), name.wx_str()); + hicon = ::LoadIcon(wxGetInstance(), name.t_str()); } // next check if it's not a standard icon diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index c6c4de551a..6e543752ab 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -268,7 +268,7 @@ void wxHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx) // notice that we need to store the string we use the pointer to until we // pass it to the control hdi.mask |= HDI_TEXT; - wxWxCharBuffer buf = col.GetTitle().wx_str(); + wxWxCharBuffer buf = col.GetTitle().t_str(); hdi.pszText = buf.data(); hdi.cchTextMax = wxStrlen(buf); diff --git a/src/msw/helpchm.cpp b/src/msw/helpchm.cpp index cdb46e21af..2c33e930d9 100644 --- a/src/msw/helpchm.cpp +++ b/src/msw/helpchm.cpp @@ -127,7 +127,7 @@ bool wxCHMHelpController::DisplaySection(const wxString& section) if ( section.Find(wxT(".htm")) != wxNOT_FOUND ) { // interpret as a file name - return CallHtmlHelp(HH_DISPLAY_TOPIC, section.wx_str()); + return CallHtmlHelp(HH_DISPLAY_TOPIC, wxMSW_CONV_LPCTSTR(section)); } return KeywordSearch(section); @@ -184,7 +184,7 @@ bool wxCHMHelpController::ShowContextHelpPopup(const wxString& text, const wxPoint& pos, wxWindow *window) { - return DoDisplayTextPopup(text.wx_str(), pos, 0, window); + return DoDisplayTextPopup(text.t_str(), pos, 0, window); } bool wxCHMHelpController::DisplayBlock(long block) @@ -201,7 +201,7 @@ bool wxCHMHelpController::KeywordSearch(const wxString& k, HH_AKLINK link; link.cbStruct = sizeof(HH_AKLINK); link.fReserved = FALSE; - link.pszKeywords = k.wx_str(); + link.pszKeywords = k.t_str(); link.pszUrl = NULL; link.pszMsgText = NULL; link.pszMsgTitle = NULL; diff --git a/src/msw/helpwin.cpp b/src/msw/helpwin.cpp index 72339e4d98..f379594228 100644 --- a/src/msw/helpwin.cpp +++ b/src/msw/helpwin.cpp @@ -63,7 +63,7 @@ bool wxWinHelpController::DisplayContents(void) wxString str = GetValidFilename(m_helpFile); - return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_FINDER, 0L) != 0); + return (WinHelp(GetSuitableHWND(this), str.t_str(), HELP_FINDER, 0L) != 0); } bool wxWinHelpController::DisplaySection(int section) @@ -73,7 +73,7 @@ bool wxWinHelpController::DisplaySection(int section) wxString str = GetValidFilename(m_helpFile); - return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_CONTEXT, (DWORD)section) != 0); + return (WinHelp(GetSuitableHWND(this), str.t_str(), HELP_CONTEXT, (DWORD)section) != 0); } bool wxWinHelpController::DisplayContextPopup(int contextId) @@ -82,7 +82,7 @@ bool wxWinHelpController::DisplayContextPopup(int contextId) wxString str = GetValidFilename(m_helpFile); - return (WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_CONTEXTPOPUP, (DWORD) contextId) != 0); + return (WinHelp(GetSuitableHWND(this), str.t_str(), HELP_CONTEXTPOPUP, (DWORD) contextId) != 0); } bool wxWinHelpController::DisplayBlock(long block) @@ -98,8 +98,8 @@ bool wxWinHelpController::KeywordSearch(const wxString& k, wxString str = GetValidFilename(m_helpFile); - return WinHelp(GetSuitableHWND(this), str.wx_str(), HELP_PARTIALKEY, - (ULONG_PTR)k.wx_str()) != 0; + return WinHelp(GetSuitableHWND(this), str.t_str(), HELP_PARTIALKEY, + (ULONG_PTR)wxMSW_CONV_LPCTSTR(k)) != 0; } // Can't close the help window explicitly in WinHelp diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index 604a452962..7d7505636f 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -257,13 +257,13 @@ bool wxIniConfig::IsEmpty() const { wxChar szBuf[1024]; - GetPrivateProfileString(m_strGroup.wx_str(), NULL, wxT(""), + GetPrivateProfileString(m_strGroup.t_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf), - m_strLocalFilename.wx_str()); + m_strLocalFilename.t_str()); if ( !wxIsEmpty(szBuf) ) return false; - GetProfileString(m_strGroup.wx_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf)); + GetProfileString(m_strGroup.t_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf)); if ( !wxIsEmpty(szBuf) ) return false; @@ -284,13 +284,13 @@ bool wxIniConfig::DoReadString(const wxString& szKey, wxString *pstr) const // first look in the private INI file // NB: the lpDefault param to GetPrivateProfileString can't be NULL - GetPrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), wxT(""), + GetPrivateProfileString(m_strGroup.t_str(), strKey.t_str(), wxT(""), szBuf, WXSIZEOF(szBuf), - m_strLocalFilename.wx_str()); + m_strLocalFilename.t_str()); if ( wxIsEmpty(szBuf) ) { // now look in win.ini wxString strKey = GetKeyName(path.Name()); - GetProfileString(m_strGroup.wx_str(), strKey.wx_str(), + GetProfileString(m_strGroup.t_str(), strKey.t_str(), wxT(""), szBuf, WXSIZEOF(szBuf)); } @@ -311,8 +311,8 @@ bool wxIniConfig::DoReadLong(const wxString& szKey, long *pl) const static const int nMagic = 17; // 17 is some "rare" number static const int nMagic2 = 28; // arbitrary number != nMagic - long lVal = GetPrivateProfileInt(m_strGroup.wx_str(), strKey.wx_str(), - nMagic, m_strLocalFilename.wx_str()); + long lVal = GetPrivateProfileInt(m_strGroup.t_str(), strKey.t_str(), + nMagic, m_strLocalFilename.t_str()); if ( lVal != nMagic ) { // the value was read from the file *pl = lVal; @@ -320,8 +320,8 @@ bool wxIniConfig::DoReadLong(const wxString& szKey, long *pl) const } // is it really nMagic? - lVal = GetPrivateProfileInt(m_strGroup.wx_str(), strKey.wx_str(), - nMagic2, m_strLocalFilename.wx_str()); + lVal = GetPrivateProfileInt(m_strGroup.t_str(), strKey.t_str(), + nMagic2, m_strLocalFilename.t_str()); if ( lVal != nMagic2 ) { // the nMagic it returned was indeed read from the file *pl = lVal; @@ -345,9 +345,9 @@ bool wxIniConfig::DoWriteString(const wxString& szKey, const wxString& szValue) wxConfigPathChanger path(this, szKey); wxString strKey = GetPrivateKeyName(path.Name()); - bool bOk = WritePrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), - szValue.wx_str(), - m_strLocalFilename.wx_str()) != 0; + bool bOk = WritePrivateProfileString(m_strGroup.t_str(), strKey.t_str(), + szValue.t_str(), + m_strLocalFilename.t_str()) != 0; if ( !bOk ) { @@ -382,7 +382,7 @@ bool wxIniConfig::Flush(bool /* bCurrentOnly */) { // this is just the way it works return WritePrivateProfileString(NULL, NULL, NULL, - m_strLocalFilename.wx_str()) != 0; + m_strLocalFilename.t_str()) != 0; } // ---------------------------------------------------------------------------- @@ -395,16 +395,16 @@ bool wxIniConfig::DeleteEntry(const wxString& szKey, bool bGroupIfEmptyAlso) wxConfigPathChanger path(this, szKey); wxString strKey = GetPrivateKeyName(path.Name()); - if (WritePrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), - NULL, m_strLocalFilename.wx_str()) == 0) + if (WritePrivateProfileString(m_strGroup.t_str(), strKey.t_str(), + NULL, m_strLocalFilename.t_str()) == 0) return false; if ( !bGroupIfEmptyAlso || !IsEmpty() ) return true; // delete the current group too - bool bOk = WritePrivateProfileString(m_strGroup.wx_str(), NULL, - NULL, m_strLocalFilename.wx_str()) != 0; + bool bOk = WritePrivateProfileString(m_strGroup.t_str(), NULL, + NULL, m_strLocalFilename.t_str()) != 0; if ( !bOk ) { @@ -420,8 +420,8 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey) // passing NULL as section name to WritePrivateProfileString deletes the // whole section according to the docs - bool bOk = WritePrivateProfileString(path.Name().wx_str(), NULL, - NULL, m_strLocalFilename.wx_str()) != 0; + bool bOk = WritePrivateProfileString(path.Name().t_str(), NULL, + NULL, m_strLocalFilename.t_str()) != 0; if ( !bOk ) { @@ -438,7 +438,7 @@ bool wxIniConfig::DeleteGroup(const wxString& szKey) bool wxIniConfig::DeleteAll() { // first delete our group in win.ini - WriteProfileString(GetVendorName().wx_str(), NULL, NULL); + WriteProfileString(GetVendorName().t_str(), NULL, NULL); // then delete our own ini file wxChar szBuf[MAX_PATH]; diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index fd17da4b41..c01c325a5c 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -251,7 +251,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const if (bCase) return wxItemContainerImmutable::FindString( s, bCase ); - int pos = ListBox_FindStringExact(GetHwnd(), -1, s.wx_str()); + int pos = ListBox_FindStringExact(GetHwnd(), -1, s.t_str()); if (pos == LB_ERR) return wxNOT_FOUND; else @@ -473,7 +473,7 @@ void wxListBox::SetString(unsigned int n, const wxString& s) if ( n == (m_noItems - 1) ) newN = -1; - ListBox_InsertString(GetHwnd(), newN, s.wx_str()); + ListBox_InsertString(GetHwnd(), newN, s.t_str()); // restore the client data if ( oldData ) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index ee3d370fb7..5a605efb8e 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1542,7 +1542,7 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial) findInfo.flags = LVFI_STRING; if ( partial ) findInfo.flags |= LVFI_PARTIAL; - findInfo.psz = str.wx_str(); + findInfo.psz = str.t_str(); // ListView_FindItem() excludes the first item from search and to look // through all the items you need to start from -1 which is unnatural and @@ -3279,7 +3279,7 @@ static void wxConvertToMSWListItem(const wxListCtrl *ctrl, else { // pszText is not const, hence the cast - lvItem.pszText = (wxChar *)info.m_text.wx_str(); + lvItem.pszText = wxMSW_CONV_LPTSTR(info.m_text); if ( lvItem.pszText ) lvItem.cchTextMax = info.m_text.length(); else @@ -3300,7 +3300,7 @@ static void wxConvertToMSWListCol(HWND hwndList, if ( item.m_mask & wxLIST_MASK_TEXT ) { lvCol.mask |= LVCF_TEXT; - lvCol.pszText = (wxChar *)item.m_text.wx_str(); // cast is safe + lvCol.pszText = wxMSW_CONV_LPTSTR(item.m_text); } if ( item.m_mask & wxLIST_MASK_FORMAT ) diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 3e4338ee95..d55fef241a 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -316,7 +316,7 @@ struct wxMSWCommandLineArguments argv = new wxChar *[argc + 1]; for ( int i = 0; i < argc; i++ ) { - argv[i] = wxStrdup(args[i].wx_str()); + argv[i] = wxStrdup(args[i].t_str()); } // argv[] must be NULL-terminated diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 101e33ea65..8b0ab4e871 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -190,7 +190,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, msflags &= ~WS_HSCROLL; if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(wxT("wxMDIFrame")), - title.wx_str(), + title.t_str(), pos, size, msflags, exflags) ) @@ -795,8 +795,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, if ( !(style & wxFULL_REPAINT_ON_RESIZE) ) className += wxApp::GetNoRedrawClassSuffix(); - mcs.szClass = className.wx_str(); - mcs.szTitle = title.wx_str(); + mcs.szClass = className.t_str(); + mcs.szTitle = title.t_str(); mcs.hOwner = wxGetInstance(); if (x != wxDefaultCoord) mcs.x = x; @@ -1473,7 +1473,7 @@ void MDIInsertWindowMenu(wxWindow *win, WXHMENU hMenu, HMENU menuWin) inserted = true; ::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)menuWin, - wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str()); + wxString(wxGetTranslation(WINDOW_MENU_LABEL)).t_str()); break; } } @@ -1482,7 +1482,7 @@ void MDIInsertWindowMenu(wxWindow *win, WXHMENU hMenu, HMENU menuWin) { ::AppendMenu(hmenu, MF_POPUP, (UINT_PTR)menuWin, - wxString(wxGetTranslation(WINDOW_MENU_LABEL)).wx_str()); + wxString(wxGetTranslation(WINDOW_MENU_LABEL)).t_str()); } } diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 8798b7d2ce..f1559bdb57 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -592,7 +592,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) } mii.cch = itemText.length(); - mii.dwTypeData = const_cast(itemText.wx_str()); + mii.dwTypeData = wxMSW_CONV_LPTSTR(itemText); if ( flags & MF_POPUP ) { @@ -715,7 +715,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) itemText = wxMenuItem::GetLabelText(itemText); #endif - pData = (wxChar*)itemText.wx_str(); + pData = itemText.t_str(); } // item might have already been inserted by InsertMenuItem() above @@ -885,7 +885,7 @@ void wxMenu::SetTitle(const wxString& label) if ( !label.empty() ) { if ( !::InsertMenu(hMenu, 0u, MF_BYPOSITION | MF_STRING, - (UINT_PTR)idMenuTitle, m_title.wx_str()) || + (UINT_PTR)idMenuTitle, m_title.t_str()) || !::InsertMenu(hMenu, 1u, MF_BYPOSITION, (unsigned)-1, NULL) ) { wxLogLastError(wxT("InsertMenu")); @@ -911,7 +911,7 @@ void wxMenu::SetTitle(const wxString& label) info.fMask = MIIM_TYPE; info.fType = MFT_STRING; info.cch = m_title.length(); - info.dwTypeData = const_cast(m_title.wx_str()); + info.dwTypeData = wxMSW_CONV_LPTSTR(m_title); if ( !SetMenuItemInfo(hMenu, 0, TRUE, & info) ) { wxLogLastError(wxT("SetMenuItemInfo")); @@ -919,7 +919,7 @@ void wxMenu::SetTitle(const wxString& label) #else if ( !ModifyMenu(hMenu, 0u, MF_BYPOSITION | MF_STRING, - (UINT_PTR)idMenuTitle, m_title.wx_str()) ) + (UINT_PTR)idMenuTitle, m_title.t_str()) ) { wxLogLastError(wxT("ModifyMenu")); } @@ -1127,7 +1127,7 @@ WXHMENU wxMenuBar::Create() HMENU hPopupMenu = (HMENU) GetMenu(i)->GetHMenu(); tbButton.dwData = (DWORD)hPopupMenu; wxString label = wxStripMenuCodes(GetMenuLabel(i)); - tbButton.iString = (int) label.wx_str(); + tbButton.iString = (int) wxMSW_CONV_LPCTSTR(label); tbButton.idCommand = NewControlId(); if ( !::SendMessage(hCommandBar, TB_INSERTBUTTON, i, (LPARAM)&tbButton) ) @@ -1156,7 +1156,7 @@ WXHMENU wxMenuBar::Create() { if ( !::AppendMenu((HMENU)m_hMenu, MF_POPUP | MF_STRING, (UINT_PTR)(*it)->GetHMenu(), - (*it)->GetTitle().wx_str()) ) + (*it)->GetTitle().t_str()) ) { wxLogLastError(wxT("AppendMenu")); } @@ -1265,7 +1265,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label) info.fMask = MIIM_TYPE; info.fType = MFT_STRING; info.cch = label.length(); - info.dwTypeData = const_cast(label.wx_str()); + info.dwTypeData = wxMSW_CONV_LPTSTR(label); if ( !SetMenuItemInfo(GetHmenu(), id, TRUE, &info) ) { wxLogLastError(wxT("SetMenuItemInfo")); @@ -1273,7 +1273,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label) #else if ( ::ModifyMenu(GetHmenu(), mswpos, MF_BYPOSITION | MF_STRING | flagsOld, - id, label.wx_str()) == (int)0xFFFFFFFF ) + id, label.t_str()) == (int)0xFFFFFFFF ) { wxLogLastError(wxT("ModifyMenu")); } @@ -1318,7 +1318,7 @@ wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) if ( !::InsertMenu(GetHmenu(), (UINT)mswpos, MF_BYPOSITION | MF_POPUP | MF_STRING, - (UINT_PTR)GetHmenuOf(menu), title.wx_str()) ) + (UINT_PTR)GetHmenuOf(menu), title.t_str()) ) { wxLogLastError(wxT("InsertMenu")); } @@ -1373,7 +1373,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) HMENU hPopupMenu = (HMENU) menu->GetHMenu() ; tbButton.dwData = (DWORD)hPopupMenu; wxString label = wxStripMenuCodes(title); - tbButton.iString = (int) label.wx_str(); + tbButton.iString = (int) wxMSW_CONV_LPCTSTR(label); tbButton.idCommand = NewControlId(); if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton)) @@ -1385,7 +1385,7 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) #else if ( !::InsertMenu(GetHmenu(), mswpos, MF_BYPOSITION | MF_POPUP | MF_STRING, - (UINT_PTR)GetHmenuOf(menu), title.wx_str()) ) + (UINT_PTR)GetHmenuOf(menu), title.t_str()) ) { wxLogLastError(wxT("InsertMenu")); } @@ -1434,7 +1434,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) HMENU hPopupMenu = (HMENU) menu->GetHMenu() ; tbButton.dwData = (DWORD)hPopupMenu; wxString label = wxStripMenuCodes(title); - tbButton.iString = (int) label.wx_str(); + tbButton.iString = (int) wxMSW_CONV_LPCTSTR(label); tbButton.idCommand = NewControlId(); if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_INSERTBUTTON, pos, (LPARAM)&tbButton)) @@ -1444,7 +1444,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) } #else if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING, - (UINT_PTR)submenu, title.wx_str()) ) + (UINT_PTR)submenu, title.t_str()) ) { wxLogLastError(wxT("AppendMenu")); } diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index b9414823aa..509f021654 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -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); } } diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 843983b43a..06f9a2a68f 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -205,7 +205,7 @@ wxMetafileDCImpl::wxMetafileDCImpl(wxDC *owner, const wxString& file, m_maxY = -10000; if ( !file.empty() && wxFileExists(file) ) wxRemoveFile(file); - m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : file.wx_str()); + m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : wxMSW_CONV_LPCTSTR(file)); m_ok = true; diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 08b91774ce..d2e06d4b79 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -271,7 +271,7 @@ void wxMessageDialog::ReplaceStaticWithEdit() HWND hwndEdit = ::CreateWindow ( wxT("EDIT"), - wxTextBuffer::Translate(text).wx_str(), + wxTextBuffer::Translate(text).t_str(), WS_CHILD | WS_VSCROLL | WS_VISIBLE | ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL, rc.left, rc.top, @@ -373,7 +373,7 @@ void wxMessageDialog::AdjustButtonLabels() if ( widthNeeded > wBtnNew ) wBtnNew = widthNeeded; - ::SetWindowText(hwndBtn, label.wx_str()); + ::SetWindowText(hwndBtn, label.t_str()); } if ( wBtnNew <= wBtnOld ) @@ -584,7 +584,7 @@ int wxMessageDialog::ShowMessageBox() #endif // wxUSE_MSGBOX_HOOK // do show the dialog - int msAns = MessageBox(hWnd, message.wx_str(), m_caption.wx_str(), msStyle); + int msAns = MessageBox(hWnd, message.t_str(), m_caption.t_str(), msStyle); return MSWTranslateReturnCode(msAns); } @@ -696,7 +696,7 @@ void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc) TDF_POSITION_RELATIVE_TO_WINDOW | TDF_SIZE_TO_CONTENT; tdc.hInstance = wxGetInstance(); - tdc.pszWindowTitle = caption.wx_str(); + tdc.pszWindowTitle = caption.t_str(); // use the top level window as parent if none specified tdc.hwndParent = parent ? GetHwndOf(parent) : NULL; @@ -713,12 +713,12 @@ void wxMSWTaskDialogConfig::MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc) // message in our ctor, see comment there. if ( !extendedMessage.empty() ) { - tdc.pszMainInstruction = message.wx_str(); - tdc.pszContent = extendedMessage.wx_str(); + tdc.pszMainInstruction = message.t_str(); + tdc.pszContent = extendedMessage.t_str(); } else { - tdc.pszContent = message.wx_str(); + tdc.pszContent = message.t_str(); } // set an icon to be used, if possible @@ -802,7 +802,7 @@ void wxMSWTaskDialogConfig::AddTaskDialogButton(TASKDIALOGCONFIG &tdc, TASKDIALOG_BUTTON &tdBtn = buttons[tdc.cButtons]; tdBtn.nButtonID = btnCustomId; - tdBtn.pszButtonText = customLabel.wx_str(); + tdBtn.pszButtonText = customLabel.t_str(); tdc.cButtons++; // We should never have more than 4 buttons currently as this is the diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 5990c012bc..2a3a46fe78 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -412,7 +412,7 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) TC_ITEM tcItem; tcItem.mask = TCIF_TEXT; - tcItem.pszText = (wxChar *)strText.wx_str(); + tcItem.pszText = wxMSW_CONV_LPTSTR(strText); if ( !HasFlag(wxNB_MULTILINE) ) return TabCtrl_SetItem(GetHwnd(), nPage, &tcItem) != 0; @@ -686,7 +686,7 @@ bool wxNotebook::InsertPage(size_t nPage, if ( !strText.empty() ) { tcItem.mask |= TCIF_TEXT; - tcItem.pszText = const_cast(strText.wx_str()); + tcItem.pszText = wxMSW_CONV_LPTSTR(strText); } // hide the page: unless it is selected, it shouldn't be shown (and if it diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 8558237ec9..ad02bc6be3 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -154,7 +154,7 @@ private: void wxDataFormat::SetId(const wxString& format) { - m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format.wx_str()); + m_format = (wxDataFormat::NativeFormat)::RegisterClipboardFormat(format.t_str()); if ( !m_format ) { wxLogError(_("Couldn't register clipboard format '%s'."), format); @@ -1152,7 +1152,7 @@ bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const #endif // wxUSE_UNICODE_MSLU { len = m_filenames[i].length(); - memcpy(pbuf, m_filenames[i].wx_str(), len*sizeOfChar); + memcpy(pbuf, m_filenames[i].t_str(), len*sizeOfChar); } pbuf += len*sizeOfChar; diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index 6fb88beabb..0b0a8e513e 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -90,7 +90,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, const wxRect& rc, int cx = rc.GetWidth() - GetMarginWidth(); int cy = sizeRect.cy; - ::DrawState(hdc, NULL, NULL, (LPARAM)text.wx_str(), + ::DrawState(hdc, NULL, NULL, wxMSW_CONV_LPARAM(text), text.length(), x, y, cx, cy, flags); } // reset to default the font, colors and brush diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index 857be199c4..9faae50050 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -65,7 +65,7 @@ public: BOOL Open( const wxString& printerName, LPPRINTER_DEFAULTS pDefault=(LPPRINTER_DEFAULTS)NULL ) { Close(); - return OpenPrinter( (LPTSTR)printerName.wx_str(), &m_hPrinter, pDefault ); + return OpenPrinter( wxMSW_CONV_LPTSTR(printerName), &m_hPrinter, pDefault ); } BOOL Close() @@ -391,7 +391,7 @@ void wxWindowsPrintNativeData::InitializeDevMode(const wxString& printerName, Wi if (m_devMode) return; - LPTSTR szPrinterName = (LPTSTR)printerName.wx_str(); + LPTSTR szPrinterName = wxMSW_CONV_LPTSTR(printerName); // From MSDN: How To Modify Printer Settings with the DocumentProperties() Function // The purpose of this is to fill the DEVMODE with privdata from printer driver. @@ -494,7 +494,7 @@ void wxWindowsPrintNativeData::InitializeDevMode(const wxString& printerName, Wi bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) { WinPrinter printer; - LPTSTR szPrinterName = (LPTSTR)data.GetPrinterName().wx_str(); + LPTSTR szPrinterName = wxMSW_CONV_LPTSTR(data.GetPrinterName()); if (!m_devMode) InitializeDevMode(data.GetPrinterName(), &printer); @@ -524,7 +524,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) // NB: the cast is needed in the ANSI build, strangely enough // dmDeviceName is BYTE[] and not char[] there wxStrlcpy(reinterpret_cast(devMode->dmDeviceName), - name.wx_str(), + name.t_str(), WXSIZEOF(devMode->dmDeviceName)); } diff --git a/src/msw/progdlg.cpp b/src/msw/progdlg.cpp index 8191f6b084..50c3f5b974 100644 --- a/src/msw/progdlg.cpp +++ b/src/msw/progdlg.cpp @@ -170,7 +170,7 @@ BOOL CALLBACK DisplayCloseButton(HWND hwnd, LPARAM lParam) { sharedData->m_labelCancel = _("Close"); SendMessage( hwnd, WM_SETTEXT, 0, - (LPARAM) sharedData->m_labelCancel.wx_str() ); + wxMSW_CONV_LPARAM(sharedData->m_labelCancel) ); return FALSE; } @@ -212,7 +212,7 @@ void PerformNotificationUpdates(HWND hwnd, } if ( sharedData->m_notifications & wxSPDD_TITLE_CHANGED ) - ::SetWindowText( hwnd, sharedData->m_title.wx_str() ); + ::SetWindowText( hwnd, sharedData->m_title.t_str() ); if ( sharedData->m_notifications & wxSPDD_MESSAGE_CHANGED ) { @@ -245,12 +245,12 @@ void PerformNotificationUpdates(HWND hwnd, ::SendMessage( hwnd, TDM_SET_ELEMENT_TEXT, TDE_MAIN_INSTRUCTION, - (LPARAM) title.wx_str() ); + wxMSW_CONV_LPARAM(title) ); ::SendMessage( hwnd, TDM_SET_ELEMENT_TEXT, TDE_CONTENT, - (LPARAM) body.wx_str() ); + wxMSW_CONV_LPARAM(body) ); } if ( sharedData->m_notifications & wxSPDD_EXPINFO_CHANGED ) @@ -262,7 +262,7 @@ void PerformNotificationUpdates(HWND hwnd, ::SendMessage( hwnd, TDM_SET_ELEMENT_TEXT, TDE_EXPANDED_INFORMATION, - (LPARAM) expandedInformation.wx_str() ); + wxMSW_CONV_LPARAM(expandedInformation) ); } } @@ -806,7 +806,7 @@ void* wxProgressDialogTaskRunner::Entry() if ( !m_sharedData.m_expandedInformation.empty() ) { tdc.pszExpandedInformation = - m_sharedData.m_expandedInformation.wx_str(); + m_sharedData.m_expandedInformation.t_str(); } } diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 1414e04edd..e7dd3514a6 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -203,7 +203,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowIDRef subid = NewControlId(); HWND hwndBtn = ::CreateWindow(wxT("BUTTON"), - choices[i].wx_str(), + choices[i].t_str(), styleBtn, 0, 0, 0, 0, // will be set in SetSize() GetHwndOf(parent), diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index dd98c124cc..144009b810 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -33,10 +33,10 @@ #include "wx/dynlib.h" #include "wx/file.h" #include "wx/wfstream.h" +#include "wx/msw/private.h" // Windows headers #ifdef __WXWINCE__ -#include "wx/msw/private.h" #include #include #endif diff --git a/src/msw/richmsgdlg.cpp b/src/msw/richmsgdlg.cpp index fe0bb4940d..3b8aa11187 100644 --- a/src/msw/richmsgdlg.cpp +++ b/src/msw/richmsgdlg.cpp @@ -47,14 +47,14 @@ int wxRichMessageDialog::ShowModal() // add a checkbox if ( !m_checkBoxText.empty() ) { - tdc.pszVerificationText = m_checkBoxText.wx_str(); + tdc.pszVerificationText = m_checkBoxText.t_str(); if ( m_checkBoxValue ) tdc.dwFlags |= TDF_VERIFICATION_FLAG_CHECKED; } // add collapsible footer if ( !m_detailedText.empty() ) - tdc.pszExpandedInformation = m_detailedText.wx_str(); + tdc.pszExpandedInformation = m_detailedText.t_str(); TaskDialogIndirect_t taskDialogIndirect = GetTaskDialogIndirectFunc(); if ( !taskDialogIndirect ) diff --git a/src/msw/slider.cpp b/src/msw/slider.cpp index 23e8f0ac87..1b87047ed2 100644 --- a/src/msw/slider.cpp +++ b/src/msw/slider.cpp @@ -583,7 +583,7 @@ void wxSlider::SetValue(int value) if ( m_labels ) { - ::SetWindowText((*m_labels)[SliderLabel_Value], Format(value).wx_str()); + ::SetWindowText((*m_labels)[SliderLabel_Value], Format(value).t_str()); } } @@ -603,9 +603,9 @@ void wxSlider::SetRange(int minValue, int maxValue) if ( m_labels ) { ::SetWindowText((*m_labels)[SliderLabel_Min], - Format(ValueInvertOrNot(m_rangeMin)).wx_str()); + Format(ValueInvertOrNot(m_rangeMin)).t_str()); ::SetWindowText((*m_labels)[SliderLabel_Max], - Format(ValueInvertOrNot(m_rangeMax)).wx_str()); + Format(ValueInvertOrNot(m_rangeMax)).t_str()); } // When emulating wxSL_INVERSE style in wxWidgets, we need to update the diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 0017413e0a..921d767fb0 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -452,7 +452,7 @@ void wxSpinCtrl::SetValue(int val) // to leave it like this, while we really want to always show the // current value in the control, so do it manually ::SetWindowText(GetBuddyHwnd(), - wxString::Format(wxT("%d"), val).wx_str()); + wxString::Format(wxT("%d"), val).t_str()); } m_oldValue = GetValue(); diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 213ac65d6a..784d07481d 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -460,13 +460,13 @@ void wxStaticBox::PaintForeground(wxDC& dc, const RECT& rc) if ( !rtl ) { RECT rc2 = { x, 0, x + width, y }; - ::DrawText(hdc, label.wx_str(), label.length(), &rc2, + ::DrawText(hdc, label.t_str(), label.length(), &rc2, drawTextFlags); } else // RTL { RECT rc2 = { x, 0, x - width, y }; - ::DrawText(hdc, label.wx_str(), label.length(), &rc2, + ::DrawText(hdc, label.t_str(), label.length(), &rc2, drawTextFlags | DT_RTLREADING); } } diff --git a/src/msw/statusbar.cpp b/src/msw/statusbar.cpp index f4284ab52d..321df1bb05 100644 --- a/src/msw/statusbar.cpp +++ b/src/msw/statusbar.cpp @@ -317,7 +317,7 @@ void wxStatusBar::DoUpdateStatusText(int nField) // Set the status text in the native control passing both field number and style. // NOTE: MSDN library doesn't mention that nField and style have to be 'ORed' - if ( !StatusBar_SetText(GetHwnd(), nField | style, text.wx_str()) ) + if ( !StatusBar_SetText(GetHwnd(), nField | style, text.t_str()) ) { wxLogLastError("StatusBar_SetText"); } @@ -563,7 +563,7 @@ void wxStatusBar::SetStatusStyles(int n, const int styles[]) // the fields' styles. // NOTE: MSDN library doesn't mention that nField and style have to be 'ORed' wxString text = GetStatusText(i); - if (!StatusBar_SetText(GetHwnd(), style | i, text.wx_str())) + if (!StatusBar_SetText(GetHwnd(), style | i, text.t_str())) { wxLogLastError("StatusBar_SetText"); } diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 9822509db1..4141b0e3c8 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -226,7 +226,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) notifyData.uFlags |= NIF_TIP; if ( !tooltip.empty() ) { - wxStrlcpy(notifyData.szTip, tooltip.wx_str(), WXSIZEOF(notifyData.szTip)); + wxStrlcpy(notifyData.szTip, tooltip.t_str(), WXSIZEOF(notifyData.szTip)); } bool ok = wxShellNotifyIcon(m_iconAdded ? NIM_MODIFY @@ -271,8 +271,8 @@ wxTaskBarIcon::ShowBalloon(const wxString& title, notifyData = NotifyIconData(hwnd); notifyData.uFlags |= NIF_INFO; notifyData.uTimeout = msec; - wxStrlcpy(notifyData.szInfo, text.wx_str(), WXSIZEOF(notifyData.szInfo)); - wxStrlcpy(notifyData.szInfoTitle, title.wx_str(), + wxStrlcpy(notifyData.szInfo, text.t_str(), WXSIZEOF(notifyData.szInfo)); + wxStrlcpy(notifyData.szInfoTitle, title.t_str(), WXSIZEOF(notifyData.szInfoTitle)); if ( flags & wxICON_INFORMATION ) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 4f02fbaf85..b4f5be57ef 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -427,7 +427,7 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, // implementation detail m_updatesCount = -2; - if ( !MSWCreateControl(windowClass.wx_str(), msStyle, pos, size, valueWin) ) + if ( !MSWCreateControl(windowClass.t_str(), msStyle, pos, size, valueWin) ) return false; m_updatesCount = -1; @@ -1109,7 +1109,7 @@ void wxTextCtrl::DoWriteText(const wxString& value, int flags) ::SendMessage(GetHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT, // EM_REPLACESEL takes 1 to indicate the operation should be redoable - selectionOnly ? 1 : 0, (LPARAM)valueDos.wx_str()); + selectionOnly ? 1 : 0, wxMSW_CONV_LPARAM(valueDos)); if ( !ucf.GotUpdate() && (flags & SetValue_SendEvent) ) { diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index e993654d24..02936ead75 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -625,7 +625,7 @@ wxTextEntry::~wxTextEntry() void wxTextEntry::WriteText(const wxString& text) { - ::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, (LPARAM)text.wx_str()); + ::SendMessage(GetEditHwnd(), EM_REPLACESEL, 0, wxMSW_CONV_LPARAM(text)); } wxString wxTextEntry::DoGetValue() const diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 697b9c6c8d..884fedaf40 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -985,7 +985,7 @@ bool wxToolBar::Realize() { const wxString& label = tool->GetLabel(); if ( !label.empty() ) - button.iString = (INT_PTR)label.wx_str(); + button.iString = (INT_PTR) wxMSW_CONV_LPCTSTR(label); } button.idCommand = tool->GetId(); 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); } diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 315d02dea9..e43e038530 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -473,7 +473,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, if ( !title.empty() ) { - ::SetWindowText(GetHwnd(), title.wx_str()); + ::SetWindowText(GetHwnd(), title.t_str()); } SubclassWin(m_hWnd); @@ -523,7 +523,7 @@ bool wxTopLevelWindowMSW::CreateFrame(const wxString& title, #endif return MSWCreate(MSWGetRegisteredClassName(), - title.wx_str(), pos, sz, flags, exflags); + title.t_str(), pos, sz, flags, exflags); } bool wxTopLevelWindowMSW::Create(wxWindow *parent, diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 1251bd8dc3..7963ab4331 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -959,7 +959,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) return; wxTreeViewItem tvItem(item, TVIF_TEXT); - tvItem.pszText = (wxChar *)text.wx_str(); // conversion is ok + tvItem.pszText = wxMSW_CONV_LPTSTR(text); DoSetItem(&tvItem); // when setting the text of the item being edited, the text control should @@ -972,7 +972,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) { if ( item == m_idEdited ) { - ::SetWindowText(hwndEdit, text.wx_str()); + ::SetWindowText(hwndEdit, text.t_str()); } } } @@ -1476,7 +1476,7 @@ wxTreeItemId wxTreeCtrl::DoInsertAfter(const wxTreeItemId& parent, if ( !text.empty() ) { mask |= TVIF_TEXT; - tvIns.item.pszText = (wxChar *)text.wx_str(); // cast is ok + tvIns.item.pszText = wxMSW_CONV_LPTSTR(text); } else { diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index d672e75d5d..292efc5dd1 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -141,7 +141,7 @@ bool wxGetHostName(wxChar *buf, int maxSize) !regKey.QueryValue(wxT("Name"), hostName) ) return false; - wxStrlcpy(buf, hostName.wx_str(), maxSize); + wxStrlcpy(buf, hostName.t_str(), maxSize); #else // !__WXWINCE__ DWORD nSize = maxSize; if ( !::GetComputerName(buf, &nSize) ) diff --git a/src/msw/utilsgui.cpp b/src/msw/utilsgui.cpp index 7c44c41a18..c18e1eaf59 100644 --- a/src/msw/utilsgui.cpp +++ b/src/msw/utilsgui.cpp @@ -373,7 +373,7 @@ bool wxLaunchDefaultApplication(const wxString& document, int flags) wxUnusedVar(flags); WinStruct sei; - sei.lpFile = document.wx_str(); + sei.lpFile = document.t_str(); #ifdef __WXWINCE__ sei.nShow = SW_SHOWNORMAL; // SW_SHOWDEFAULT not defined under CE (#10216) #else diff --git a/src/msw/volume.cpp b/src/msw/volume.cpp index 5414ddb7ad..24a774b35c 100644 --- a/src/msw/volume.cpp +++ b/src/msw/volume.cpp @@ -612,7 +612,7 @@ wxIcon wxFSVolume::GetIcon(wxFSIconType type) const } SHFILEINFO fi; - long rc = SHGetFileInfo(m_volName.wx_str(), 0, &fi, sizeof(fi), flags); + long rc = SHGetFileInfo(m_volName.t_str(), 0, &fi, sizeof(fi), flags); m_icons[type].SetHICON((WXHICON)fi.hIcon); if (!rc || !fi.hIcon) { diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index e8a3119150..833491c3ed 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -403,7 +403,7 @@ bool wxToolMenuBar::Realize() const wxString& label = tool->GetLabel(); if ( !label.empty() ) { - button.iString = (int)label.wx_str(); + button.iString = (int) wxMSW_CONV_LPCTSTR(label); } } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index c6f86a72b7..9285777c3d 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2174,7 +2174,7 @@ void wxWindowMSW::DoGetTextExtent(const wxString& string, SIZE sizeRect; TEXTMETRIC tm; - ::GetTextExtentPoint32(hdc, string.wx_str(), string.length(), &sizeRect); + ::GetTextExtentPoint32(hdc, string.t_str(), string.length(), &sizeRect); GetTextMetrics(hdc, &tm); if ( x ) @@ -3761,8 +3761,8 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass, m_hWnd = (WXHWND)::CreateWindowEx ( extendedStyle, - className.wx_str(), - title ? title : m_windowName.wx_str(), + className.t_str(), + title ? title : m_windowName.t_str(), style, x, y, w, h, (HWND)MSWGetParent(), @@ -3882,7 +3882,7 @@ bool wxWindowMSW::HandleTooltipNotify(WXUINT code, ( CP_ACP, 0, // no flags - ttip.wx_str(), + ttip.t_str(), tipLength, buf, WXSIZEOF(buf) - 1 @@ -5826,7 +5826,7 @@ int wxWindowMSW::HandleMenuChar(int WXUNUSED_IN_WINCE(chAccel), wxMenuItem *item = (wxMenuItem*)mii.dwItemData; const wxString label(item->GetItemLabel()); - const wxChar *p = wxStrchr(label.wx_str(), wxT('&')); + const wxChar *p = wxStrchr(label.t_str(), wxT('&')); while ( p++ ) { if ( *p == wxT('&') ) -- 2.45.2