
这是我的文件保存:
。。。。。
CString strFileName=MyFileDlg.m_ofn.lpstrFile;
CString strExtension;
//
if (strFileName.Right(4).MakeLower()!=".txt")
if (MyFileDlg.m_ofn.nFileExtension == 0)
{
switch (MyFileDlg.m_ofn.nFilterIndex)
{
case 1:
strExtension = "txt";
break;
default:
break;
}
strFileName = strFileName + '.' + strExtension;
}
。。。。。。