About MS VC++ 6

Can any experts tell me how to use MS VC++ 6 edition to
create a simple 'ADD' program.

For example, it should have three textboxes and one button.
Two textboxes are for inputs and ine textbox is for output
of the addition from these two textboxes.

Can you show me step by step ?
LVL 1
tanc02Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GlennDeanCommented:
tanc02:
   Here's some steps:
1.  Create a project using the MFC App Wizard and choose a Dialog-based app
2.  Open up the resource editor and open up the dialog resource.  Then, add 4 controls from the control tool (3 edit boxes and one button).
3.  In ClassWizard, add data members for the 3 edit boxes.  Make sure you don't accept ClassWizard's default of CString for the member type (choose double).  What creating a data member accomplishes is when the user changes the data on the screen the framework will change the data member to reflect the changes.  Call the 3 members m_dLeft, m_dRight, m_dAnswer.
4.  Also in ClassWizard, on the Message Map tab, click on the button resource id (the default should be IDC_BUTTON1) and then add a handler for BN_CLICKED.
5.  Edit the code for the BN_CLICKED handler.  Should look something like:
   UpdateData(TRUE); //Get data from screen
   m_dAnswer=m_dLeft+m_dRight;
   UpdateData(FALSE); //Store data onto screen

   Good luck,
           Glenn
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tanc02Author Commented:
when I compiled, it told me that my three variables were undeclared
0
GlennDeanCommented:
tanc02:
   The problem you're probably having is that when you add the member variables via ClassWizard, make sure you're on the Member Variables tab, and make sure the Class Name is the name of the Dialog containing the 3 edit boxes you've added to the dialog.
   Also note that you have to add the edit boxes to the dialog first before you add the member variables (the default ID's for the boxes should be IDC_EDIT1,IDC_EDIT2,IDC_EDIT3).  Then, on the member variables tab, highlight the id and then click Add Variable.
   Glenn
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.