Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 22nd, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. writing to a file mfc
  2. CString strFileContent;
  3. CString strFilePath;
  4.  
  5. CFile theFile(strFilePath, CFile::modeReadWrite | CFile::modeCreate);
  6.  
  7. // write BOM if you like
  8. // WCHAR bom = 0xFEFF;
  9. // theFile.Write(&bom, 2);
  10.  
  11. theFile.Write( (LPCTSTR) strFileContent,
  12.     strFileContent.GetLength() * sizeof(TCHAR));