Results 1 to 5 of 5

Thread: Basic MFC question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166

    Basic MFC question

    Hi there!

    If I have a dialog-based app with edit-boxes on it. I have namned these boxes and added functions through the classwizard, but now I've got a question.

    A name for a box is IDC_source, how do I get the text in the box to go into a string-variable?

    thanks for your help!
    [p r a e t o r i a n]

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Wouldn't the class wizard do that for you?

    There's some function called DDX_Text, it reads from a editbox to a CString object...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166
    I just want what the user writes in the box to get into a string.....? Is that possible?
    [p r a e t o r i a n]

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    If you design the dialog box in the resource editor and then doubleclick on it, the class wizard will pop up and ask you to make a class for the dialog. There you select the tab member variables and add a CString variable for each edit box. Then, when you want the data, you call a member function of your dialog class (I think something like UpdateData - I don't really know). After this, all CString objects contain the data of their associated edit boxes.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166
    Ok, thanks!

    I'll test that later today!
    [p r a e t o r i a n]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width