用文件操作啊~
你为该对话框添加WM_DESTROY消息,在OnDestroy函数中添加如下代码:
FILE * stream = fopen("C:\\abc.txt", "w"); // 假设文件名为C:\abc.txt
CWnd * pWnd = NULL;
CString strText;
pWnd = GetDlgItem(IDC_EDIT1); // 假设编辑框1的ID为IDC_EDIT1
pWnd->GetWindowText(strText);
fprintf(stream, "%s\n", strText);
pWnd = GetDlgItem(IDC_EDIT2); // 假设编辑框2的ID为IDC_EDIT2
pWnd->GetWindowText(strText);
fprintf(stream, "%s\n", strText);
fclose(stream);