CString strLogPathname = m_strPrjPathname;
char dirver[_MAX_DRIVE], path[_MAX_PATH], filename[_MAX_FNAME], ext[_MAX_EXT];
_splitpath(strLogPathname.GetBuffer(1024), dirver, path, filename, ext);
strLogPathname.ReleaseBuffer();
strLogPathname = dirver; //得到
strLogPathname += path;
strLogPathname =strLogPathname + filename +".txt";
CFile file(strLogPathname,CFile::modeCreate | CFile::modeWrite);
CMainFrame* pMainFrm = (CMainFrame*)AfxGetMainWnd();
ArrLog pArrLog;
int nCount = pMainFrm->GetAllOutPutInfo(&pArrLog);
for(int i = 0; i < nCount; i++)
{ CString strText = pArrLog[i].m_strLog ;
strText.TrimLeft(); //删除文本中的左边的空格
strText.TrimRight();//删除文本中的右边的空格
strText.trim();//删除文本中的左边与右边的空格
if (!strText.IsEmpty())
{
strText += "/r/n";
file.Write(strText, strText.GetLength());
}
}
file.Close();