展开全部
CStdioFile stdFile;
CString strList = "";
CString strExcel = "";
CString strTemp = "";
stdFile.Open(sExcelFile, CFile::modeCreate | CFile::modeRead | CFile::modeNoTruncate | CFile::typeText);
while(stdFile.ReadString(strTemp))
strExcel = strExcel + strTemp + "\n";
stdFile.Close();
stdFile.Open(sExcelFile, CFile::modeWrite | CFile::typeText);
for (int i = 0; i < pList->GetItemCount(); i ++)
{
strList.Empty();
for (int j = 0; j < pList->GetHeaderCtrl()->GetItemCount(); j++)
{
strTemp = pList->GetItemText(i, j);
strList = strList + strTemp + "\t";
}
strExcel = strExcel + strList + "\n";
}
stdFile.WriteString((LPCTSTR)strExcel);
stdFile.Close();
CString strList = "";
CString strExcel = "";
CString strTemp = "";
stdFile.Open(sExcelFile, CFile::modeCreate | CFile::modeRead | CFile::modeNoTruncate | CFile::typeText);
while(stdFile.ReadString(strTemp))
strExcel = strExcel + strTemp + "\n";
stdFile.Close();
stdFile.Open(sExcelFile, CFile::modeWrite | CFile::typeText);
for (int i = 0; i < pList->GetItemCount(); i ++)
{
strList.Empty();
for (int j = 0; j < pList->GetHeaderCtrl()->GetItemCount(); j++)
{
strTemp = pList->GetItemText(i, j);
strList = strList + strTemp + "\t";
}
strExcel = strExcel + strList + "\n";
}
stdFile.WriteString((LPCTSTR)strExcel);
stdFile.Close();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询