One afternoon, the entire log writing function, I feel that the path parameters of the open function are always incorrect. In msdn, I only mentioned that the path parameters can be full paths or default paths, however, some other situations are not described. An afternoon is wasted. When using the full path, you can use the write function to write data to the corresponding folder. However, when using the default path, the written log file does not exist, after several hours, I don't know why. I finally found the answer in my query by Uncle Google.
Before opening the log file, I called the cfiledialog class. So when I opened the log file using the open function, it became the path of the default program instead of the path of my current program. After testing, all the log files are generated to the current path selected in the dialog box. Good luck.
When using the cfile or cstdiofile class to open a file, do not mix it with the cfiledialog class because it will modify your default path or change it to the full path to record the file, so that you do not forget it later.
This article is from the "West sun" blog, please be sure to keep this source http://thgenius.blog.51cto.com/1042803/1567630
Cfile OPEN function path in VC