Cfile OPEN function path in VC

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.