You can check out CFile, if you want to stick with the MFC stuff and not mess with STL or the C file input/output functions. For CFile:
http://msdn.microsoft.com/library/de..._MFC_CFile.asp
As for how to write a string to a file using STL, you should be using the GetBuffer() and GetLength() methods of CString and then writing to the file as a character array, you shouldn't be using the << and >> operators, those do something slightly different for CString objects than they do for regular stl string objects.
-Fredric
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
Offline 80 posts
since Aug 2005