I am trying to build a simple calculator in vc++ for that i don't get how to access the integer value from CEdit is there any method to do that?
I am trying to build a simple calculator in vc++ for that i don't get how to access the integer value from CEdit is there any method to do that?
AbHHinaay
Yes. It is
)
When you create the resource in the resource editor. You must create a class for your form( if you haven't do that). T o create that class press Ctrl and triple clicks onto the form and the IDE will create one for you.
Let's suppose you already have one or you created iy succesfully...
Go to View ->ClassWizard. From the Class combobox choose the class for your form and choose Member variables tab. In the listbox Control IDs choose the identifier of your editbox. It must be something like this: IDC_EDIT1, if you haven't changed it's name. Than click the Add Variable button enter the name of the variable, choose the category to be value ant type to be int.
You now have an integer, associated with control. When you must get the value of the control you should first
call UpdateData(true) of the dialog class.
Am I clear?
I'm, talking about VC++
You declare object of type CEdit if you want to call methods for the editbox. If you want just to get the value you don't need such a thing. You can do it just with a variable, which is associated to the control.
To get an object of type CEdit, which is associated with the EditBox. Go again to the Class Wizard and go to add new variable, as I explained to you before.
For category choose Control and then for type CEdit. This object will become a member of your dialog class.
You can have both an object and an integer associated with one control.
If you didn't understand something ask again.
)
P.S. Sorry for my bad English.