Thread: Question

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    19

    Question

    Hi,
    I’m rather new to windows programming and trying to make my first program with WinApi. As a first program I chose calculator. I have done the GUI part and currently trying to make the calculation. But that is the thing, what causes me the problems…I just cant figure out how to do it. So my question would be, what algorithm (I don’t know, id its the best word for describing that, maybe function would be better) to use for getting values from 2 fields, multiplying them (also subtraction, addition etc.) and printing the value to Static text.

  2. #2
    </life>
    Join Date
    Oct 2004
    Posts
    83
    statictext = value1 * value2

    ?
    Microsoft is merely an illusion, albeit a very persistant one.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Once you have the text of the number you need to convert it to a number, you can do this using the atoi function.
    Then as dagdarian said value1*value2.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    19
    Hi,
    I'm sorry, I couldn't answer before, but I could reform my question: How to take input from a field and later display it at Static text? (Considering I can do neither)

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    There are any number of basic tutorials which show you how to create a simple dialog and get values back from it.
    http://faq.cprogramming.com/cgi-bin/...&id=1031248558
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM