UpdateData function in VC ++

I am not so familiar with VC ++ programming. I heard that when reading / writing to the text box of the window, we should use the update data function. (UpdateData (true), UpdateData (false)). Otherwise, we will not be able to perform the read / write operation in the text field.

Why do we use this feature? What does this function do?

+3
source share
1 answer

The mechanism is called dynamic data exchange. When you call the UpdateData method, it inturn sets the member of the CDataExchange class and calls DoDataExchange. DDX is nothing more than global functions that internally call SetDlgItemText or GetDlgItemText.

/ ,

CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);
pBoxOne->SetDlgItemText("asd");
+1

All Articles