i created some dialogs on another dialog as childs. when i
wanted to access a dialog within another member-
wnd<AbfrageDlg> dlg = try_child<AbfrageDlg>
this didn't work (always returned null_wnd). the only way
to access the dialog will be to save it in a member-
variable or find it with find_wnd_range() which is very
cumbersome and not consistent with the access to
so i printed out the dlg_ctrl_id's of all childs and the
dialogs all had an id of 0. i figured it out that in
template<class impl, class params> inline wnd<impl>
create_dlg_impl( params p, hwnd_proxy parent, const
create_info & info );
dialogs will be created and this could be the place to
apply a small patch:
p_result->dlg_ctrl_id(id); <-- this line is new!
the call to try_child() now succeeds. but what if the user
adds one dialog more than once? they would have the
same id and that isn't acceptable...
a solution would be to have a new parameter in the
create_dlg()-functions which specifies the id the dialog is
given. to be consistent with written code this parameter
must have a default value. best would be to have the
result of dialog_impl::dialog_id() as the default value.
i know you're in trouble with time so i rewrote dialog.hpp
and window.hpp and attached it here ;-). the changes
are enclosed in
blocks so you can easily find them. i tested it and it
works perfectly :-)
Log in to post a comment.