]> git.mxchange.org Git - flightgear.git/commitdiff
Further Windows SGpath fixes
authorJames Turner <zakalawe@mac.com>
Tue, 28 Jun 2016 15:52:42 +0000 (16:52 +0100)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:37 +0000 (23:27 +0200)
src/GUI/WindowsFileDialog.cxx

index b082efa72cbd99f3a1074f97912883ff7c4b41ea..8a5b2ff97e23a6c5d4c8b0a4c2cc379d1d6af70a 100644 (file)
@@ -47,7 +47,8 @@ static int CALLBACK BrowseFolderCallback(
     if (uMsg == BFFM_INITIALIZED) {
                // set the initial directory now
                WindowsFileDialog* dlg = reinterpret_cast<WindowsFileDialog*>(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<char *>(_initialPath.c_str());
+       std::string s = _initialPath.local8BitStr();
+    opf.lpstrInitialDir =  const_cast<char *>(s.c_str());
     
     if (_showHidden) {
         opf.Flags = OFN_PATHMUSTEXIST;