Thread: Beginner in VC++, A simple "Hello world" progarm.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User ski6ski's Avatar
    Join Date
    Aug 2001
    Posts
    133
    Well first I would do this on a dialog. Have a static text called Name: followed by a edit control with a member variable called m_Name. Then on the next line have another static text called First Number: followed by another edit control with a member variable called m_First. (Do the same for Second, and Total).

    Then have a button labeld Get Total. And on the OnGetTotal() fuction declare 3 variables of type int for your First, Second and Total and one variable of type CString Name.

    Use m_First.GetWindowText(First);
    Use the same for Second and Name.

    Then Total = First + Second.

    <edit:>
    m_Total.SetWindowText("Hello "+Name+" your total is "+Total);
    </edit>

    And call UpdateData(FALSE);
    Last edited by ski6ski; 12-11-2001 at 08:54 AM.
    C++ Is Powerful
    I use C++
    There fore I am Powerful

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Simple stupid question from a beginner
    By oyerth in forum C++ Programming
    Replies: 1
    Last Post: 04-07-2002, 06:32 PM
  3. A simple c++ question..Im a beginner
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-04-2001, 04:25 PM
  4. C++ Beginner Simple Calculator
    By mom in forum C++ Programming
    Replies: 3
    Last Post: 10-19-2001, 12:51 AM
  5. Major Beginner looking for simple pointers
    By dlkchic in forum C++ Programming
    Replies: 4
    Last Post: 09-05-2001, 12:27 PM