Questions tagged [cfiledialog]
51 questions
7
votes
3 answers
Initial directory is not working for CFileDialog
I am using CFileDialog, I have set the initial path like below , as shown in the code. It's not working . Correct me if I made a mistake.
CFileDialog* filedlg = new CFileDialog(TRUE,(LPCTSTR)NULL , (LPCTSTR)NULL , OFN_HIDEREADONLY|…

jack
- 355
- 1
- 4
- 12
7
votes
2 answers
Why CFileDialog::GetNextPathName doesn't work when the file path is long?
Using CFileDialog class, I select multiple files placed in a directory with a long path. It's OK when I select only one or two files; but when I select three files at the same time it returns only a part of the third file path. (Looks like it's…

Javid
- 2,755
- 2
- 33
- 60
6
votes
2 answers
CFileDialog::OnInitDialog() does not call
I am using custom file dialog which is extended from the CFileDialog.
The problem is that, OninitDialog() does not get called before DoModal().
I have customized the CFileDialog in the OninitDialog().
I am using VS 2012 with Win7 OS.
I could not…
user2210724
4
votes
2 answers
CFileDialog with OFN_ALLOWMULTISELECT incorrect results for shortcuts
Can someone let me know what am I doing wrong here?
MFC project, I'm using CFileDialog to let user pick multiple files, as such:
CFileDialog fd(TRUE, NULL, NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER | OFN_ALLOWMULTISELECT,
…

c00000fd
- 20,994
- 29
- 177
- 400
4
votes
2 answers
How can I set the default file type for a CFileDialog?
I am using CFileDialog for displaying the open file dialog. I have set the filter as follows:
static TCHAR BASED_CODE szFilter[] = _T("Chart Files (*.xlc)|*.xlc|")
_T("Worksheet Files (*.xls)|*.xls|Data Files…

Pankaj
- 259
- 3
- 16
4
votes
2 answers
Problems with CFileDialog instantiation
I'm following the definition for CFileDialog, yet VS2013 is still telling me that there is no constructor available for the arguments that I'm passing in.
My Code:
CFile theFile;
char strFilter[] = { "TXT Files (*.txt)|*.txt|All Files (*.*)|*.*||"…

JayB
- 397
- 6
- 21
2
votes
1 answer
MFC CFileDialog - Getting special folder path on windows 7
All.
I have some problem during writing an mfc application.
It is using the sample project, posted on below url, to implement multiple selection on CFileDialog.
http://www.codeproject.com/KB/MFC/SelectDialog.aspx
It works fine on Windows Xp but has…

jinbruce627
- 133
- 8
2
votes
1 answer
Setting the folder view in a CFileDialog (MFC)
Is there a standard way to set the folder view in a CFileDialog (Vista-style enabled)? I'm trying to get it to show Details view and some custom columns.
I've implemented a Windows 7 column handler that displays app-specific info for files created…

cue
- 41
- 4
2
votes
2 answers
How to hook an event to CFileDialog?
I'm trying to make a 'Save As' dialog with an event that would change the default path based on the type of file we choose from the filters combo box. The problem is, all the examples I've seen execute the code on result IDOK or IDCANCEL while I'd…

bananeeek
- 153
- 1
- 2
- 11
2
votes
0 answers
The new folder button created for virtual folder cannot be displayed in CFileDialog
By using shell namespace extension, I create a virtual folder and add a "New Folder" button on the toolbar, and I can see the button when I use windows explorer to open it:
The related code about the "New Folder" button is simple:
class…

beasone
- 1,073
- 1
- 14
- 32
2
votes
1 answer
CFileDialog multiple CSV file types
I'm giving a user a CFileDialog to save their work. One of the file types supported is CSV, but within CSV there are a couple variations (e.g., row-major, column-major, etc.). I know I can add controls to the dialog to allow such a choice but…

Swiss Frank
- 1,985
- 15
- 33
2
votes
2 answers
Does this Microsoft CFileDialog example lead to a potential memory violation
I've been experiencing a number of random crashes using the MFC CFileDialog class so I had a look at their example code from this page which reads as follows;
#define MAX_CFileDialog_FILE_COUNT 99
#define FILE_LIST_BUFFER_SIZE…

SmacL
- 22,555
- 12
- 95
- 149
2
votes
1 answer
MFC CFileDialog and lpstrInitialDir
According to the documentation for the OPENFILENAME structure, the following algorithm is used to select the initial directory:
Windows 7:
If lpstrInitialDir has the same value as was passed the first time the application used an Open or Save As…

Skynight
- 507
- 2
- 7
- 24
2
votes
3 answers
CFileDialog freezes when launched from Modeless Dialog
I'm attempting to call CFileDialog to allow the user to select a file.
My program is a MFC application and I am using VS2005.
Here is my problem:
I have main View that creates a modeless dialog box. In this dialog box I have a menu item that…

Tyler Jackson
- 37
- 6
2
votes
1 answer
CFileDialog truncates offered file name
I have strange behaviour of CFileDialog once it is opened. The offered file name looks like it has been truncated, so that only last n characters are visible:
image http://ves.fijmovi.com/cpp/CFileDialog_1.jpg
As soon as I click on space for name, I…

ves
- 21
- 4