Problem in CFileOpenDialog
-
Hi, I have done report genaration project in vc++. I have show some data on the window from database and save that data into file. I just found out that it only crashes when the files are on the desktop.That is when i try to open the file on desktop using CFileOpendialog, my application going to closed. But that file placed on any other drives like(c:,d:,..), nothing to worry, it will execute successfully...
-
Hi, I have done report genaration project in vc++. I have show some data on the window from database and save that data into file. I just found out that it only crashes when the files are on the desktop.That is when i try to open the file on desktop using CFileOpendialog, my application going to closed. But that file placed on any other drives like(c:,d:,..), nothing to worry, it will execute successfully...
-
Hi, I have done report genaration project in vc++. I have show some data on the window from database and save that data into file. I just found out that it only crashes when the files are on the desktop.That is when i try to open the file on desktop using CFileOpendialog, my application going to closed. But that file placed on any other drives like(c:,d:,..), nothing to worry, it will execute successfully...
-
Hi, I have done report genaration project in vc++. I have show some data on the window from database and save that data into file. I just found out that it only crashes when the files are on the desktop.That is when i try to open the file on desktop using CFileOpendialog, my application going to closed. But that file placed on any other drives like(c:,d:,..), nothing to worry, it will execute successfully...
-
Hello Judy, what is the right way to handle the spaces in the file name and file path? regards termal
Without seeing your code, I can't tell. It all depends on what you do with the name after you get it. Some of the APIs that take a file name (no, I don't remember which ones off the top of my head, and there isn't a list I'm aware of) need to have "" around a name that has spaces in it. Run with the debugger and see where it crashes. Judy
-
Without seeing your code, I can't tell. It all depends on what you do with the name after you get it. Some of the APIs that take a file name (no, I don't remember which ones off the top of my head, and there isn't a list I'm aware of) need to have "" around a name that has spaces in it. Run with the debugger and see where it crashes. Judy
JudyL_FL wrote:
Some of the APIs that take a file name...
But what do those have to do with
CFileDialog
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Hi, I have done report genaration project in vc++. I have show some data on the window from database and save that data into file. I just found out that it only crashes when the files are on the desktop.That is when i try to open the file on desktop using CFileOpendialog, my application going to closed. But that file placed on any other drives like(c:,d:,..), nothing to worry, it will execute successfully...
Without seeing how you are using
CFileDialog
, help is going to be hard to come by. Have you tried usingGetOpenFileName()
to see if the problem is specific to MFC? What is the value of_WIN32_WINNT
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
JudyL_FL wrote:
Some of the APIs that take a file name...
But what do those have to do with
CFileDialog
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
Nothing. I missed that the probelm was in that function and not after he calls it in the original post. OP: Have you tried using the debugger? The CFileDialog class does handle the desktop correctly - I've used it to do that and it's fine. Using the debugger will pinpoint where the problem is. You've probably made some mistake in the setup prior to calling the function, and seeing where in the class the crash occurs will provice lots of clues about where the problem is. You need to post some code and use the debugger. Judy