Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving a file

Status
Not open for further replies.

Augustus

IS-IT--Management
Dec 12, 2002
1
US
hi..
juz want to know how to save a file in visual C++ after the user clicks ok on the Cfiledialog window ...been trying everything..nothing seems to work....

Another pt...my application is basically a dialog based application that opens a file (using fopen) and does some processing and displaying...

how do i save it after doing the processing..? will be grateful...

augustus


 
Augustus,

The CFileDialog class simply displays a dialog box and let's you retrieve information from it ie filename and location. It doesn't actually do any opening,reading,writing or closing of the file.

Use the CFileDialog to get information for your file. I strongly recommend using CStdioFile or some other derivative of CFile. These all encapsulate the fopen, fclose etc. They make it very easy to write/read to a file.

After you have got the file information from the dialog box create an instance of CStdioFile using the information you have collected. Write to the file and close it.


Bluehorseshoe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top