This is a question on Dialog Data Exchange
On the button press you want to use UpdateData(TRUE)
to set the CString control values m_nedit1
and m_nedit2
.
Then you build your m_nedit3
string in whatever way you mean by "calculate". Then you synchronise the change back to the dialog controls with UpdateData(FALSE)
.
For example lets presume you meant concatenation:
UpdateData(TRUE);
m_nedit3 = m_nedit1 + m_nedit2;
UpdateData(FALSE);
You should handle the case UpdateData(FALSE)
returning FALSE. This would mean the sync failed accordingly to any DDV conditions you may have imposed, e.g. maximum string length.
int
ordoulbe
but not of typeCString
. - Jabberwocky