CFiledialog save problem with win7

Oct 25, 2011 at 9:36am
Hi everybody!
I have a problem with CFiledialog Save button in Win7.
I use MFC and VC++ 2010. I'm developing the application under win xp and there are no problems. When I launch the sofware under win 7, the filedialog save pop up opens but when I press the "Save" button nothing happens! I can press the button a thousand times but nothing happens! if I write the name of an existing file it works fine.
I try to used OPENFILEDIALOG, but the problem persist.

What's the problem?

Thanks!
Oct 25, 2011 at 12:38pm
Sorry I can't really answer your question, but in Vista and 7 there is the newer Common Item Dialog. Maybe you can throw in an OS version check and display the proper dialog that way.

Here's the MSDN page if you're interested:
http://msdn.microsoft.com/en-us/library/bb776913%28VS.85%29.aspx
Last edited on Oct 25, 2011 at 12:41pm
Oct 26, 2011 at 2:42pm
thank, but I get the same problem with this new method...

ideas?
Oct 26, 2011 at 3:29pm
What directory are you trying to save to? It's possible that you need elevated priveledges. Does it work if you save to your documents or desktop or if you run your application as administrator?
Last edited on Oct 26, 2011 at 3:30pm
Oct 26, 2011 at 5:39pm
It doesn't work in any directory, even the administrator privileges. Sometimes it works (once in a billion). It's crazy. I don't know what else to try.
Thanks!
Oct 27, 2011 at 12:22pm
I couldn't guess at the problem. Can you post your code for saving?
Oct 28, 2011 at 8:26am
Solved! .. but don't ask me how! I created a new solution and built it the same source files and now runs on both xp and 7!

Thanks a lot for your time!
Oct 28, 2011 at 1:29pm
Strange that it is solved as it seems to be the standard behavior in Windows 7. For example, I am currently browsing this website with Google Chrome. If I hit Ctrl+S, I get the Save As dialog with a filename pre-filled. If I delete the filename and then click Save, nothing happens, just like you described it.

So if you fixed it, you must have fixed it differently. Maybe you changed the dialog flags and don't remember?

In any case I fail to see an actual problem here. Why is it so important that the Save button work even without a filename?
Oct 28, 2011 at 1:55pm
Why is it so important that the Save button work even without a filename?


As I understood the problem was saving files that don't already exist, not saving without a filename.
Oct 28, 2011 at 10:30pm
I see. Could be. The dialog is configurable. You can tell it to accept existing files only or not. Maybe this is the setting that was changed.
Oct 30, 2011 at 1:41pm
no no the code is the same.. after pressing the "Save" button several times nothing happened.. if I wrote the name of an existing file, there were no problems! At code level never went out of the DoModal () method of CFilefialog.. Now, with build a new solution with the same cose, it seems to work.. although about 1 pc of 5 tested doesn't work correctly (on win7).
Topic archived. No new replies allowed.