Open igiso opened 11 years ago
Thank you. I edited the title a bit to describe the problem better.
adding OFN_NOCHANGEDIR to ofn.Flags should help
@lewezero can you help a little bit more? How to add OFN_NOCHANGEDIR to ofn.Flags? I'm using Visual Studio (2015-2022 was able to compile on both, but using 2015 setup)
Well, if I recall correctly what I meant back then, the following line in the snippet from ofSystemUtils.cpp
posted above by @igiso:
ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
should instead read:
ofn.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
Hi all, I noticed that when we use the ofSystemSaveDialog() function on PC
it changes the getCurrentWorkingDirectory() and this breaks the path directory in OF
So when you try to load an image or save an xml OF can't find the path because it looks to the directory you saved your files.
This only occurs under windows.
on Mac getCurrentWorkingDirectory() points to the same spot after the dialog
///
The problem is inside the ofSystemSaveDialog in the ofSystemUtils.cpp
the way to deal with this now is after the
: saveFileResult.bSuccess or before you need to load or save something in data again.
you put once: ofSetDataPathRoot(DEFAULT_DIRECTORY);
the DEFAULT_DIRECTORY is a string I initialize in setup with
DEFAULT_DIRECTORY = ofToDataPath("",true);
Not sure how we can solve this from within the function
related forum post:
http://forum.openframeworks.cc/index.php/topic,13382.msg57346.html#msg57346