how can i get int input by CEdit

This is a discussion on how can i get int input by CEdit within the Windows Programming forums, part of the Platform Specific Boards category; I am trying to build a simple calculator in vc++ for that i don't get how to access the integer ...

  1. #1
    Registered User planet_abhi's Avatar
    Join Date
    Oct 2002
    Posts
    92

    how can i get int input by CEdit

    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

  2. #2
    Registered User
    Join Date
    Sep 2003
    Posts
    87
    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?

  3. #3
    Registered User planet_abhi's Avatar
    Join Date
    Oct 2002
    Posts
    92
    i'm doing this in vc++ and where is CEdit?
    AbHHinaay

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    87
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  2. Game Won't Compile
    By jothesmo in forum C++ Programming
    Replies: 2
    Last Post: 04-01-2006, 03:24 PM
  3. easy if you know how to use functions...
    By Unregistered in forum C Programming
    Replies: 7
    Last Post: 01-31-2002, 06:34 AM
  4. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 05:05 PM
  5. A Simple (?) Problem
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 10-12-2001, 04:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21