Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Need help extracting data from an edit box.
I am new to mfc programming and I am working on a very simple program. All I have is an edit box. I want the user to enter a number and then I update the variable that represents that number. However, I cant seem to get what I want. The id of the edit box is IDC_MSG. The variable attached to it is m_strMessage of type int.
I want the variable to update whenever the user enters a new value and then hits the enter key. I am not sure which message to use. I tried EN_CHANGE and EN_UPDATE and placed UpdateData(TRUE) in those functions.
What happened though is the the function was called any time the data was changed (after each keystroke), when I want it to work only after the enter key is hit.
(If the function is called any time the data is changed, the check to see if the int is in the proper min-max range occurs each time and that messe things up).
If anything is unclear please let me know and I will do my best to clarify it.
Thanx for the help,