16,501
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
class USERACTION : public CDialogEx
{
CString filename;
int m_predict;
//类申明过程省略
}
//消息映射
BEGIN_MESSAGE_MAP(USERACTION, CDialogEx)
ON_BN_CLICKED(IDOK, &USERACTION::OnBnClickedOk)
END_MESSAGE_MAP()
void USERACTION::OnBnClickedOk()
{
// TODO: 在此添加控件通知处理程序代码
CString str;
if(filename.IsEmpty())
{
MessageBox("请选择数据文件路径");
OnBnClickedSetcolor();//数据文件打开对话框函数
}
str.Format("%d",m_predict);
::WritePrivateProfileString(_T("INFO"),_T("SELECT"),str,_T(".\\config.ini"));
::WritePrivateProfileString(_T("INFO"),_T("PATH"),filename,_T(".\\config.ini"));
CDialogEx::OnOK();
}
while(dlg.DoModal()!=IDOK || time <3 )
{
time++;
}
后面改为
dlgstatus=dlg.DoModal();
while(dlgstatus!=IDOK || time <3 )
{
time++;
}