简体   繁体   中英

Writing to a txt file using GetSaveFileName

I am trying to use the GetSaveFileName to store a number of strings in a txt file. The function makes use of the struct OpenFileName. I have looked thoroughly at the members of the struct under http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839%28v=vs.85%29.aspx but I still cannot figure out which member is responsible for the content of the file. In other words how can I pass the text to the txt. file opened? Or can this not be done at once, hence I should use another function subsequently?

That function is only to create the "Save as..." dialog box and retrieving the file name the user chose, not for actually saving the file; after it returned, you can retrieve the selected file name from lpstrFile and use it however you want (you will probably use ofstream to write to it).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM