Questions tagged [cfiledialog]
51 questions
0
votes
0 answers
Custom CFileDialog Position
This is a minor, but annoying issue, and I don't understand why MS have seemingly made it so complicated!
I've created a customised CFileDialog-derived class for opening image files using the 'new' IFileDialog, IFileDialogEvents and…

Kyudos
- 625
- 4
- 18
0
votes
0 answers
CFileDialog: dynamic modification of m_ofn?
C++/MFC, Windows 11. Visual Studio 2022 17.4.3.
I'm using CFileDialog to allow user to chose a file. By creating a new class derived from CFileDialog, I am being notified whenever the user changes directories (folders).
I implemented this so I could…

Woody20
- 791
- 11
- 30
0
votes
0 answers
CFileDialog::OnFolderChange() doesn't work as expected (Windows C++/MFC)
C++/MFC, Windows 11. Visual Studio 2022 17.4.3.
I'm using CFileDialog to allow user to chose a file. I want to be notified whenever the user changes directories (folders), but I can't get OnFolderChange to work. I expect OnFolderChange() to be…

Woody20
- 791
- 11
- 30
0
votes
2 answers
CFileDialog "Save" button does not return from DoModal
With the code below, the File Save dialog is displayed as expected, with two buttons: Save and Cancel. Clicking Cancel returns with result=IDCANCEL, but clicking Save or typing Enter does not return from DoModal, just repaints the Filename window.…

Woody20
- 791
- 11
- 30
0
votes
1 answer
Copying a CFileDialog file
I'm using a CFileDialog dialog box to open a file in my program. When this file gets opened, I'd also like to save a copy of that file into the directory of my program. How can I do this?
This is how I' m opening the file:
CFileDialog fileDlg(TRUE,…
user503707
0
votes
1 answer
IFileOpenDialog pointer is null when it calls from CFileDialog
I was trying to wrap CFileDialog and IFileOpenDialog in a class, here is the code:
class ITest
{
public:
virtual ~ITest(){};
virtual INT_PTR DoModal() = 0;
virtual IFileOpenDialog* GetDlg() = 0;
};
class test : public…

beasone
- 1,073
- 1
- 14
- 32
0
votes
0 answers
CFileDialog is visually different to Visual Studio File Dialog
In Visual Studio 2015 the File Dialog used by the IDE looks like this:
In my MFC application, when I use a CFileDialog, example:
CFileDialog dlgImport(TRUE,
_T(".XSL"), _T(""), OFN_ALLOWMULTISELECT | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY,…

Andrew Truckle
- 17,769
- 16
- 66
- 164
0
votes
1 answer
MFC CFileDialog open at location that was selected by user at last run
I have an MFC C++ application, which has a CFileDialog.
I call its DoModal function to open a file browse window.
I set the lpstrInitialDir, to tell it where to open the dialog at the first time
CString defaultDir = L"C:\\tmp\\";
CFileDialog…

user2924714
- 1,918
- 1
- 19
- 26
0
votes
1 answer
Get File size from CFileDialog
I am newbie from Visual Studio C++. I am using CFileDialog to get the file name and file path from user input. and now i want to use progress control that is loading process and user have to wait depend on your input file size. Now I got the file…

Zack Schulfler
- 78
- 1
- 2
- 11
0
votes
1 answer
CFileDialog save file with empty name
I have a CFileDialog and I'm trying to allow it to accept an empty value after calling the DoModal() function. I've played with the ofn flags but can't seem to get the dialog box to move forward in the process unless there is a valid entry in the…

Oscar
- 11
0
votes
2 answers
C++ MFC CFileDialog won't save
I created a MFC programm with a menu option to Save a file. When I click it it shows the CFileDialog and I can choose the location where I want to save my file. When I Click save in the Dialog, it closes the dialog, but after that it does nothing.…

willemjan92
- 57
- 1
- 11
0
votes
0 answers
CFileDialog constructor can't spot TRUE and fopen(str,"r") error
I call the CFileDialog constructor in the following method:
CFileDialog FileDlg(TRUE, ".txt", NULL, 0, strFilter);
according to the parameters in the CFileDialog constructor, the first parameter should be BOOL, but my compiler thinks it's int…
0
votes
1 answer
MFC extending CFileDialog
I need to build a control in MFC that shows previews of some files. These files are 3D models and so I need to use OpenGL to draw them and let the user interact with it (panning, zooming and so on).
I would like to extend CFileDialog class because…

IssamTP
- 2,408
- 1
- 25
- 48
0
votes
1 answer
Error when using CFileDialog to open file
I got an error:
error C2664: 'CFileDialog::CFileDialog(BOOL,LPCTSTR,LPCTSTR,DWORD,LPCTSTR,CWnd *,DWORD,BOOL)' : cannot convert parameter 5 from 'const char [52]' to 'LPCTSTR'
in the following code:
CFileDialog dlgFile(TRUE, NULL, NULL,…

Tung Pham
- 579
- 4
- 11
- 29
0
votes
1 answer
Second use of CFileDialog in my program gets the run-time error Debug Assertion failed
I have developed a simple program with MFC. It's responsible for reading and writing geotiff files using GDAL library. For this purpose, I have derived two classes from CFileDialog class named ManageOpenGeoTiffFiles and ManageSaveGeoTiffFiles each…

Sepideh Abadpour
- 2,550
- 10
- 52
- 88