Thread: UpdateData()

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470

    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,981
    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