CFileDialog FilePathDlg( TRUE, "ini", "*.ini", OFN_HIDEREADONLY, "ini", this ); //打开文件对话框
if ( FilePathDlg.DoModal( ) == IDOK )
{
m_ActionIni->FilePath = FilePathDlg.GetPathName( );
}
else
{
return;
}这段代码在打开对话框后(如我准备或正在选择文件时)有时整个程序会突然退出
if ( FilePathDlg.DoModal( ) == IDOK )
{
m_ActionIni->FilePath = FilePathDlg.GetPathName( );
}
else
{
return;
}这段代码在打开对话框后(如我准备或正在选择文件时)有时整个程序会突然退出
-----------------------------
如果是 CDialog, 把这个 this 改成 m_hWnd 试试 .
static DWORD dwFlags = OFN_HIDEREADONLY | OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST;
CFileDialog dlg(true,NULL,NULL,dwFlags,szFilter,NULL);
{
return;
}
去掉