Click to See Complete Forum and Search --> : New to programming (assigning variables to input from dialog boxes
joe joe
July 26th, 1999, 12:49 PM
I am trying to take input by a user from a dialog box and assign variables to this input and do a mathmatical computation with these variables and spit them back out into a window. I could use info on the details of doing this. I am using Visual C++ 6.0. Thanks
ChristianM
July 26th, 1999, 12:56 PM
try to use ClassWizard..
-press Ctrl-W
-go to "Member Variables"
-assign variable to your control (category : value)
-and in your code :
UpdateData(); //put the value in control to your variable
int m_value3 = m_value1 + m_value2; //do somthing with your variable
UpdateData(FALSE); //put the value in variable to your control
PS: Sorry for my english...
ALM
July 26th, 1999, 12:58 PM
You need to use the Class Wizard to "link" member variables to your dialog box's controls. This will make reading and writing the control's values simple.
Read about it in the online help and/or go through the Scribble tutorial, specifically the section related to adding dialog boxes.
Good luck!
Alvaro
laClass
July 26th, 1999, 01:01 PM
The easiest way to do this is to use the classwizard and map a new member variable to the edit box or whatever you use for the Dialoginput. The wizard then will add this information to the DoDataExchange function and you can get hold off the values by simply accessing the variable.MFC does the dataexchange for you. Do your computation and then open new window for the output or replace the text in the editcontrol with the new values.
Hope that helps.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.