Your Ad Here

Posted By

jimfred on 02/18/09


Tagged


Versions (?)

MFC, log to file


 / Published in: C++
 

  1. CFile file;
  2.  
  3. // Open file using 3 flags.
  4. file.Open( pFilename, CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite );
  5.  
  6. file.SeekToEnd(); // Seek to append. Otherwise, it'll write the beginning.
  7.  
  8. file.Write(s, s.GetLength() ); // write some CString s.
  9.  
  10. file.Close();

Report this snippet  

You need to login to post a comment.