为什么不行?<br><br>void CMainFrame::OnEditWritelog()<br>{<br> char buffer[500];<br> CFile log_file;<br> CFileException* pFileError=NULL;<br><br> TRY<br> {<br> log_file.Open("LOGTHEM.TXT",CFile::modeCreate || CFile::modeReadWrite);<br> sprintf(buffer, "jfklsdjfkljsdkl/r/n");<br>// log_file.Seek(0,CFile::end);<br> log_file.Write(buffer, strlen(buffer));<br> log_file.Close();<br> }<br> CATCH(CFileException,pFileError)<br> {<br> switch (pFileError->m_cause)<br> {<br> case CFileException::generic:<br> MessageBox("generic");<br> break;<br> }<br> }<br> END_CATCH<br>}<br><br>