[RESOLVED] CFileDialog SaveAs derfault file name problem
Hello,
I cannot define default file name with dot in FileSaveAs dialog.
The document name is "123.45.jpg". User can define different file extension jpg or bmp.
1)
CFileDialog writeDialog2(FALSE, "bmp", "123.45", OFN_EXPLORER|OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_NOREADONLYRETURN| OFN_NOCHANGEDIR,
filter, AfxGetMainWnd());
CFileDialog split .45 from file name and recognize it as extension.
2)
CFileDialog writeDialog2(FALSE, "bmp", "123.45.bmp", OFN_EXPLORER|OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_NOREADONLYRETURN| OFN_NOCHANGEDIR,
filter, AfxGetMainWnd());
When I change extension filter file name isn't changed, file always named as "123.45.bmp".
Hello,
I cannot define default file name with dot in FileSaveAs dialog.
The document name is "123.45.jpg". User can define different file extension jpg or bmp.
1)
CFileDialog writeDialog2(FALSE, "bmp", "123.45",
OFN_EXPLORER|OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_NOREADONLYRETURN| OFN_NOCHANGEDIR,
filter, AfxGetMainWnd());
CFileDialog split .45 from file name and recognize it as extension.
Well, it works exacly as it is expected to work! In te file name "123.45" "123" is the name and "45" is an extension.
How can I define file name as 123.45 and extension as bmp or jpg?
For example if I create file 123.45.txt and open it in MSWord file saveas dilaog show the correct file name 123.45 and user can change file extension from txt to doc.
I don't know. I never had any problem with default file name /extenstion.
Try to pass in the same extension (as default) that your default file name has:
If I define default file name as "123.45.bmp" and change filter in saveas dialog to *.jpg filename hasn't changed.
Function writeDialog2.GetFileExt return "bmp".
Function writeDialog2.GetPathName return "...fullpath/123.34.bmp"
I fix bug with filter sting now it's correct "BMP (*.bmp)|*.bmp|JPG (*.jpg)|*.jpg||"
You sample also doesn't work. :-(
I just change pParent to AfxGetMainWnd().
At the dialog I see only "of3" without ".12"
After I selected .txt and DoModal returned IDOK the dlg.GetPathName() returns me "fullpath\of3.12"
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.