From 3075eccacfce001dd8af35d4f64719de8f60f39e Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 26 Jun 2018 08:06:43 +0800 Subject: [PATCH] fix bug that folderbox returns an emtpy path --- source/gui/filebox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }