I have a structure in the document MyAppDoc.h:

struct StudInfo { public: CString f; //фамилия } 

I need to click on the button, the entered data is recorded in the structure StudInfo :

  void MODELESS::OnBnClickedButton3() { StudInfo s; MyControl dlg2; sf = dlg2.m_familiya; if (dlg2.DoModal() == IDOK); ;// update current record } 

    1 answer 1

    Need to swap strings

     void MODELESS::OnBnClickedButton3() { StudInfo s; MyControl dlg2; if (dlg2.DoModal() == IDOK) sf = dlg2.m_familiya; // update current record } 

    And in dlg2, in the Ok button handler, make UpdateData so that the string from the input field is written to the "m_familiya" variable.

    • Only the default value is written to this variable, and UpdateData () does not work - gvenog
    • Is m_familiya associated with an input string? What does UpdateData return? - fogbit
    • and what should return? m_familiya is connected - gvenog
    • After updatedate, the text from editbox, with which this variable is associated, should be placed in the m_familiya variable. - fogbit