
DDX_Text function causes pop-up
Quote:
> I created a dialog box and called the DDX_Text function in
> the DoDataExchange function. The problem is that if I'm
> in the dialog box and I hit the backspace key, I get a pop-
> up box that tells me to please enter a number. This is
> very annoying. I have found that this is a result of the
> verification that takes place in the DDX_Text function.
> Can I disable this pop-up or disable it for the
> backspace?
If I were a gambler, I'd place my money on the possibility that you have
an EN_CHANGE or EN_UPDATE handler that is calling UpdateData. This is
not a good design. If you want to retrieve the contents of an edit
control and put them into a local member variable, call GetWindowText.
Don't ever call UpdateData directly, unless you absolutely need to
retrieve and validate all of your controls at once. Usually, you can
get by without ever calling it directly (it's called by CDialog::OnOK).