CFileDialog interferes later used fopen?
-
Hi, Is it possible that CFileDialog interferes somehow (for example due to some mistake) later opening of a file using fopen?:confused: I have a setting dialog and its state can be loaded and saved. I'm using CFileDialog to get the file name and path to be saved/opened and serialization for the loading itself. The setting file is opened from the menu. The error occurs if I first either load or save the settings and then try to run one thing in my program. In that "one thing" a file is tried to be opened using fopen but the opening fails. If I remove the CFileDialog from loading and use static file name instead when opening a file using CFile the opening succeedes. Are there some other things that usually interfere fopen? -Janetta
-
Hi, Is it possible that CFileDialog interferes somehow (for example due to some mistake) later opening of a file using fopen?:confused: I have a setting dialog and its state can be loaded and saved. I'm using CFileDialog to get the file name and path to be saved/opened and serialization for the loading itself. The setting file is opened from the menu. The error occurs if I first either load or save the settings and then try to run one thing in my program. In that "one thing" a file is tried to be opened using fopen but the opening fails. If I remove the CFileDialog from loading and use static file name instead when opening a file using CFile the opening succeedes. Are there some other things that usually interfere fopen? -Janetta
Can you check errno variable when fopen fails? This will give you more info on why fopen failed. Tomasz Sowinski -- http://www.shooltz.com
What is "scratch" and why can everything be made from it?
-
Hi, Is it possible that CFileDialog interferes somehow (for example due to some mistake) later opening of a file using fopen?:confused: I have a setting dialog and its state can be loaded and saved. I'm using CFileDialog to get the file name and path to be saved/opened and serialization for the loading itself. The setting file is opened from the menu. The error occurs if I first either load or save the settings and then try to run one thing in my program. In that "one thing" a file is tried to be opened using fopen but the opening fails. If I remove the CFileDialog from loading and use static file name instead when opening a file using CFile the opening succeedes. Are there some other things that usually interfere fopen? -Janetta
Hi, the CFileDialog changes the current working directory when you select a particular file. Are you using the value of current directory in any way for opening the file? To prevent this change in the current directory, use the OFN_NOCHANGEDIR flag in the member variable m_ofn of CFileDialog. HTH
-
Hi, the CFileDialog changes the current working directory when you select a particular file. Are you using the value of current directory in any way for opening the file? To prevent this change in the current directory, use the OFN_NOCHANGEDIR flag in the member variable m_ofn of CFileDialog. HTH