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?
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");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With