IFileSaveDialog / Filename
-
Where can I update the edit field to reflect changes of the file name to save? I have customized my save file dialog and use CFileDlgEventHandler. There i need to set a different filename. In the file save dialog I select a filename from existing files, e.g. blah.tif. After clicking a custom checkbox I need to set e.g. blah_C1.tif. I can get and set the filename inside the handler: CComQIPtr pDlg = pfdc; pDlg->GetFileName(...) and pDlg->SetFileName(...) work, but after clicking 'Save' I get the filename previously selected (blah.tif) and not the changed one. Anyone out there with a tip to update the edit control behind the scenes?
-
Where can I update the edit field to reflect changes of the file name to save? I have customized my save file dialog and use CFileDlgEventHandler. There i need to set a different filename. In the file save dialog I select a filename from existing files, e.g. blah.tif. After clicking a custom checkbox I need to set e.g. blah_C1.tif. I can get and set the filename inside the handler: CComQIPtr pDlg = pfdc; pDlg->GetFileName(...) and pDlg->SetFileName(...) work, but after clicking 'Save' I get the filename previously selected (blah.tif) and not the changed one. Anyone out there with a tip to update the edit control behind the scenes?
Have you tried overriding the CFileDialog class (MFC)? ...that should be easier to accomplish using MFC. In order to change the text, you just need to get the control ID (use Spy++ if you can't find documentation as to the ID) and set the new text using SetWindowText()[^].
-
Have you tried overriding the CFileDialog class (MFC)? ...that should be easier to accomplish using MFC. In order to change the text, you just need to get the control ID (use Spy++ if you can't find documentation as to the ID) and set the new text using SetWindowText()[^].
I use the new Vista/W7 style COM dialogs, which use a different interface (not MFC). Hmm, obviously wrong forum (...as always...). I'll pass it to COM forum. The problem is that there must be another control above the edit control (checkbox), which holds the filename, too. The interface does not offer a function to set the filename of the checkbox. I can set the filename of the edit, but it is not passed through, when hitting OK. :(
-
I use the new Vista/W7 style COM dialogs, which use a different interface (not MFC). Hmm, obviously wrong forum (...as always...). I'll pass it to COM forum. The problem is that there must be another control above the edit control (checkbox), which holds the filename, too. The interface does not offer a function to set the filename of the checkbox. I can set the filename of the edit, but it is not passed through, when hitting OK. :(
jung-kreidler wrote:
Vista/W7 style COM dialogs
You can still use MFC if you wanted to.... ...but anywho, yeah, I couldn't help you with COM.