CFileDialog OnTypeChange issue
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I derived a class from
CFileDialog
, namedCFileDialogExt
. I override OnTypeChange, just like this:void CFileDialogExt::OnTypeChange()
{
// TODO: Add your specialized code here and/or call the base classswitch(GetOFN().nFilterIndex) { case 1: SetDefExt(\_T("bmp")); break; case 2: SetDefExt(\_T("gif")); break; case 3: SetDefExt(\_T("jpg")); break; case 4: SetDefExt(\_T("png")); break; case 5: SetDefExt(\_T("tiff")); break; } CFileDialog::OnTypeChange();
}
Default type is bmp. I type "aaa" as file name. I change the type (from combo type), as gif. The file name is still "aaa". I change again as jpg, the file name is changed as "aaa.gif" !! Is delayed by one changing ... strange ... why ? Furthermore, I change extension as tiff, the file name is "aaa.jpg", not "aaa.tiff" .... I have done wrong here ?