Thread: how to define the variable of a edit box?

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    117

    how to define the variable of a edit box?

    in MFC, i have a edit box, how to define the variable of the edit box??
    please help. thank you.

  2. #2
    Registered User The Junglist's Avatar
    Join Date
    Nov 2002
    Posts
    42
    If you're using MSVC++, and the edit box is on a dialog box, then you could use the class wizard to add a member variable for you.

    OR use this :

    CEdit m_myEditControl;

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    >> the variable of the edit box

    The HWND?

    The int resouce ID? (ie 40001)

    The #define ? (ie #define IDC_MY_EDIT 40001)

    Mainly use the WS_CHILD style
    Set the HWND PARENT (to the window or dilaog whos callback will get the msg's)
    Cast the HMENU to the int resouce ID (or its hash define) ie (HMENU)IDC_MY_EDIT,

    In the callback of the dialog or window that the HWND PARENT belongs to you can then process command msg's for IDC_MY_EDIT.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  2. Error check problem again
    By rtransfi in forum C Programming
    Replies: 6
    Last Post: 02-27-2003, 04:55 PM
  3. Limiting Characters in Edit Box :: MFC
    By kuphryn in forum Windows Programming
    Replies: 5
    Last Post: 06-02-2002, 10:21 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. queued signals problem, C programming related
    By Unregistered in forum Linux Programming
    Replies: 3
    Last Post: 01-22-2002, 12:30 AM