这是个模态对话框,你执行了两次对话框的打开,所以才弹出两次 ,分别在程序的第二行和第十二行
可以改成
NEW_USER dlg;
if(dlg.DoModal()==IDOK) {
CString str_time;
CTime mytime = CTime::GetCurrentTime();
str_time = mytime.Format("%Y-%m-%d");
CStringstr = "姓名:" + dlg.m_editName +
"\n年龄:" + dlg.m_editAge
+ "\n性别:" + dlg.m_editGender
+ "\n诊号:" + dlg.m_editClinicID
+ "\n建档时间:" + str_time
+ "\n";
MessageBox(str);
}