int MyWriteFile(CString strFileName, CString strText)
{
int nRet = 0;
CFile myFile;
myFile.Open(strFileName, CFile::modeWrite|CFile::shareExclusive|CFile::modeCreate,
NULL);
int nLen = strText.GetLength();
myFile.Write((char*)(LPCSTR)strText, nLen);
myFile.Close();
return nRet;
}
参考答案