diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp index 4caef33e..b7e4a524 100644 --- a/include/nana/gui/programming_interface.hpp +++ b/include/nana/gui/programming_interface.hpp @@ -181,7 +181,7 @@ namespace API template void enum_widgets(window wd, bool recursive, EnumFunction && fn) { - static_assert(std::is_convertible::value, "enum_widgets: The specified Widget is not a widget type."); + static_assert(std::is_convertible::type*, ::nana::widget*>::value, "enum_widgets: The specified Widget is not a widget type."); detail::enum_widgets_function enum_fn(static_cast(fn)); enum_fn.enum_widgets(wd, recursive); diff --git a/source/gui/filebox.cpp b/source/gui/filebox.cpp index 2a690894..ae90915d 100644 --- a/source/gui/filebox.cpp +++ b/source/gui/filebox.cpp @@ -997,6 +997,9 @@ namespace nana OPENFILENAME ofn; memset(&ofn, 0, sizeof ofn); + + internal_scope_guard lock; + ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = reinterpret_cast(API::root(impl_->owner)); ofn.lpstrFile = &(wfile[0]);