• Steven Weiss
    Steven Weiss

    hi john,
    the last few hours i spent tracking down an unobvious event handler looked like this:

    handle_event on_edit()
        create_modal_dlg<EditDlg> ( window() ).wait();
        return command<IDC_BTN_EDIT> ().HANDLED_BY(&me::on_edit);

    i don't know if you see it immediately...but the problem is that the second parameter to command is by default ANY_CMD_CODE.

    when i clicked on the button the dialog popped up but when i tried to close it it simple popped up again. as i now know another WM_COMMAND is sent to the button so the dialog reopens.

    this is a very hidden origin of bugs and because it will be less common to catch all WM_COMMANDs for an id can you put away the default parameter? or at least put a comment into the docs warning about this behaviour?

    mfg steven

    • John Torjo
      John Torjo

      Hi Steve,

      I will look into it, early next week.