This doesn't pertain to Windows CE, but this caused me a bit of trouble.
It seems CFileDialog (and thus GetOpenFileName and GetSaveFileName) may change the CWD. The same app behaved differently on two different XP machines.
On one machine CFileDialog would set the CWD to whatever path the user navigated to. On the other the CWD was not modified.
My workaround was to obtain the CWD before displaying the dialog and then set it back.
MSDN doesn't say anything about those routines changing the CWD.
Dan East
It seems CFileDialog (and thus GetOpenFileName and GetSaveFileName) may change the CWD. The same app behaved differently on two different XP machines.
On one machine CFileDialog would set the CWD to whatever path the user navigated to. On the other the CWD was not modified.
My workaround was to obtain the CWD before displaying the dialog and then set it back.
- Code:
#include "direct.h"
TCHAR tmp[MAX_PATH];
getcwd(tmp, sizeof(tmp));
CFileDialog fd(TRUE);
if (fd.DoModal()==IDOK) {
...
}
chdir(tmp);
MSDN doesn't say anything about those routines changing the CWD.
Dan East