What's the best to read values form a CEdit control?
In my application I need to read values (int, float) from a CEdit control. After that, when a press a button, calculations are made with these values and the result is to be shown in a CStatic control. What'sthe best way to do that?
Also, when I change the values and press the button again (so that calculations are re-made), what kind of functions (and where do I put them) do I need to update data?
Thanks.
Re: What's the best to read values form a CEdit control?
UpdateData can get data in and out of a dialog.
TN026 describes the various types of data supported
and how write custom DDX functions. Write a handler
for your button, have it call UpdateData(TRUE), then call
your calculate function, and then call UpdateData(FALSE)
and the data in the dialog will be updated. This assumes
that there is DDX mapping for all data displayed.
On this site there is an article called a SmartEdit control
in the edit controls section that can help insure valid
numeric entry. You can also use sliders with the data.
I have used those classes and they were very helpful.