From: James Turner Date: Tue, 28 Jun 2016 15:52:42 +0000 (+0100) Subject: Further Windows SGpath fixes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3138d9793ffc593d058ae05126aa996879590c9d;p=flightgear.git Further Windows SGpath fixes --- diff --git a/src/GUI/WindowsFileDialog.cxx b/src/GUI/WindowsFileDialog.cxx index b082efa72..8a5b2ff97 100644 --- a/src/GUI/WindowsFileDialog.cxx +++ b/src/GUI/WindowsFileDialog.cxx @@ -47,7 +47,8 @@ static int CALLBACK BrowseFolderCallback( if (uMsg == BFFM_INITIALIZED) { // set the initial directory now WindowsFileDialog* dlg = reinterpret_cast(lpData); - LPCTSTR path = dlg->getDirectory().c_str(); + std::string s = dlg->getDirectory().local8BitStr(); + LPCTSTR path = s.c_str(); ::SendMessage(hwnd, BFFM_SETSELECTION, true, (LPARAM) path); } return 0; @@ -90,7 +91,8 @@ void WindowsFileDialog::exec() memcpy((void*)opf.lpstrFilter, (void*)extensions.data(), extensionsLen); } - opf.lpstrInitialDir = const_cast(_initialPath.c_str()); + std::string s = _initialPath.local8BitStr(); + opf.lpstrInitialDir = const_cast(s.c_str()); if (_showHidden) { opf.Flags = OFN_PATHMUSTEXIST;