UpdateData()

This is a discussion on UpdateData() within the Windows Programming forums, part of the Platform Specific Boards category; I saw today how to use UpdateData() to grab some text in an EditBox and put it in a MessageBox, ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    363

    UpdateData()

    I saw today how to use UpdateData() to grab some text in an EditBox and put it in a MessageBox, when I click a button. But I donít think I understand UpdateData() right.

    Iíve defined a CString for the Edit Box in OnInitDialog() like this:
    Code:
    m_strread = "the last supper";
    UpdateData(FALSE);
    I donít get what UpdateData() do here- could you please explain?

    The lines for displaying that string in the MessageBox are:
    Code:
    UpdateData(TRUE);
    AfxMessageBox(m_strread);
    As I understand UpdateData() above tells to update the MessageBoxís data to EditBoxís data. Am I right?

    Thanks.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,670
    DDX and DDV Routines.

    If you really want to learn MFC, get a good book.

    gg

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    UpdateData(TRUE) updates the corresponding member variable with the data in the control.
    UpdateData(FALSE) does the opposite.

    Kuphryn

Popular pages Recent additions subscribe to a feed

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