-
November 3rd, 2010, 12:51 AM
#1
CFileDialog
Hi All
i am try to save file through CFileDialog.I search and read from google then use this code.
Code:
CString filter="Excel Files(*.xls;*.xlsx)|*.xls;*.xlsx|Text Files(*.txt)|*.txt|CSV Files(*.csv)|*.csv||";
CFileDialog fileDlg(FALSE, NULL, NULL, OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT,filter);
if(fileDlg.DoModal()==IDCANCEL)
{
return;
}
CString filepath = fileDlg.GetPathName ();
It's not working proper.When i select Text Files option from drop down from CFileDialog then Blank show in CFileDialog.
Really i don't know why this this thing happen in my application please help me
-
November 3rd, 2010, 02:18 AM
#2
Re: CFileDialog
Hi,
I copied your code into my test app and it worked fine.
What do you mean by saying "then Blank show in CFileDialog"?
If I select "Text files" in the drop down of the CFileDialog this dialog will only show text files. So if there aren't any, then the file list could be empty of course.
With regards
Programartist
-
November 3rd, 2010, 02:19 AM
#3
Re: CFileDialog
So when you select "text files" for the file type, you don't see any file in the dialog? Does the current folder has any .txt files? Did you try another folder with .txt files?
-
November 3rd, 2010, 03:07 AM
#4
Re: CFileDialog
Originally Posted by ProgramArtist
Hi,
I copied your code into my test app and it worked fine.
What do you mean by saying "then Blank show in CFileDialog"?
If I select "Text files" in the drop down of the CFileDialog this dialog will only show text files. So if there aren't any, then the file list could be empty of course.
With regards
Programartist
No there is so many text file exist.
-
November 3rd, 2010, 03:11 AM
#5
Re: CFileDialog
Originally Posted by cilu
So when you select "text files" for the file type, you don't see any file in the dialog? Does the current folder has any .txt files? Did you try another folder with .txt files?
There text file exist.When i click on Desktop Icon then file is showing.
But when i go through select file type then nothing showing in CFileDialog.
Please help me
-
November 3rd, 2010, 03:21 AM
#6
Re: CFileDialog
Hi,
there's nothing wrong with the code you've posted.
Do the files have the right extension ("*.txt")?
Are they shown if you try to show all files ("*.*")?
With regards
Programartist
-
November 3rd, 2010, 03:35 AM
#7
Re: CFileDialog
Originally Posted by ProgramArtist
Hi,
there's nothing wrong with the code you've posted.
Do the files have the right extension ("*.txt")?
Are they shown if you try to show all files ("*.*")?
With regards
Programartist
i had try all possible extension but result is same blank.
See when i select file option from CFileDialog then nothing show even My Document ,My Computer
Please help me
-
November 3rd, 2010, 04:12 AM
#8
Re: CFileDialog
Dear Msm,
I've tested exactly the code you've posted. It did work. Selecting "Text files (*.txt)" I see all folders (incl. "My Documents" which is called "Eigene Dokumente" since I'm using a German Windows) and all text files.
Can you explain in more details what exactly you're doing, what you're expecting and what are the results?
I'm using a Win XP SP3 (German).
With regards
Programartist
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|