fix issue that filebox may throw exception(#191)

This commit is contained in:
Jinhao 2017-03-20 06:33:37 +08:00
parent 3b2a8551e3
commit dcdeba7d2e
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** /**
* Filebox * Filebox
* Nana C++ Library(http://www.nanapro.org) * Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
* *
* Distributed under the Boost Software License, Version 1.0. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at * (See accompanying file LICENSE_1_0.txt or copy at

View File

@ -1,7 +1,7 @@
/* /*
* Filebox * Filebox
* Nana C++ Library(http://www.nanapro.org) * Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
* *
* Distributed under the Boost Software License, Version 1.0. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at * (See accompanying file LICENSE_1_0.txt or copy at
@ -997,6 +997,9 @@ namespace nana
OPENFILENAME ofn; OPENFILENAME ofn;
memset(&ofn, 0, sizeof ofn); memset(&ofn, 0, sizeof ofn);
internal_scope_guard lock;
ofn.lStructSize = sizeof(ofn); ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = reinterpret_cast<HWND>(API::root(impl_->owner)); ofn.hwndOwner = reinterpret_cast<HWND>(API::root(impl_->owner));
ofn.lpstrFile = &(wfile[0]); ofn.lpstrFile = &(wfile[0]);