Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UpdateData function in VC++

i am not so familiarize with the VC++ programming. i have heard that, while reading/writing to window text box, we have to use the update data function.(UpdateData(true), UpdateData(false)). Other wisw we can't perform the read/write operation on the text box.

Why we are using this function? What this function does?

like image 617
Aneesh Narayanan Avatar asked Mar 29 '26 00:03

Aneesh Narayanan


1 Answers

The mechanism is called Dynamic Data Exchange. When you call the method UpdateData it inturn sets member of the class CDataExchange and call DoDataExchange. DDX are nothing but global functions which internally calls SetDlgItemText or GetDlgItemText.

Another way of setting/getting window text is by calling those functions directly eg

CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);
pBoxOne->SetDlgItemText("asd");
like image 163
Jeeva Avatar answered Apr 03 '26 03:04

Jeeva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!