diff --git a/source/gui/filebox.cpp b/source/gui/filebox.cpp index 163ba3cf..f902f98f 100644 --- a/source/gui/filebox.cpp +++ b/source/gui/filebox.cpp @@ -1224,7 +1224,7 @@ namespace nana std::optional folderbox::show() const { #ifdef NANA_WINDOWS - path_type target; + std::optional target; CoInitialize(NULL); IFileDialog *fd(nullptr); @@ -1246,7 +1246,7 @@ namespace nana hr = si->GetDisplayName(SIGDN_FILESYSPATH, &pwstr); if (SUCCEEDED(hr)) { - target = pwstr; + target = path_type{ pwstr }; // use the c-string pointed to by pwstr here CoTaskMemFree(pwstr); }