大家帮帮忙--创建一个文件,将列表框的内容添加到文件中,或者文件读到列表框中 如题? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 从文件中读出,怎么写入可以参考msdn,差不多的CStdioFile InFile; // CString strTmp; if(!InFile.Open(LogFileName, CFile::modeRead)) { MessageBox("无法打开该文件!"); } else { while(InFile.GetPosition() != InFile.GetLength()) { InFile.ReadString(strTmp); GetListCtrl().InsertItem(count,strTmp); count = count + 1; } //..关闭文件 InFile.Close(); } 我来混分,把写入的函数也写出来吧在ClassWizard中替列表框加个控件型变量 m_ctrListCStdioFile InFile; // CString strTmp; if(!InFile.Open(LogFileName, CFile::modeCreate|CFile::modeWrite)) { MessageBox("无法打开该文件!"); } else { for (int i=0;i<m_ctrList.GetCount();i++) { m_ctrList.GetText(i,strTmp); InFile.WriteString(strTmp+"\n"); } //..关闭文件 InFile.Close(); } 关于录音文件同名覆盖问题 Inno setup 谁到要遇到的问题 散分了!问几个很菜的问题! 急!如何得到命令行中编译器的编译结果 如何释放变量? int n = ((int) - 1);这样的运算是啥意思? 使用CreateProcess问题(当一个程序启动时启动另外一个程序) huhu 我想做个简单的edit 谁代代我阿~~ 我的程序在没有vc的机器上运行时,打开有表格控件的对话框就会出错,请问我如何处理这个错误 关于资源复制的问题 调试问题高分赠送 请教各位大侠,如何在VC6中实现XP的风格界面!
CStdioFile InFile; //
CString strTmp;
if(!InFile.Open(LogFileName, CFile::modeRead))
{
MessageBox("无法打开该文件!");
}
else
{
while(InFile.GetPosition() != InFile.GetLength())
{
InFile.ReadString(strTmp);
GetListCtrl().InsertItem(count,strTmp);
count = count + 1;
}
//..关闭文件
InFile.Close();
}
在ClassWizard中替列表框加个控件型变量 m_ctrList
CStdioFile InFile; //
CString strTmp;
if(!InFile.Open(LogFileName, CFile::modeCreate|CFile::modeWrite))
{
MessageBox("无法打开该文件!");
}
else
{
for (int i=0;i<m_ctrList.GetCount();i++)
{
m_ctrList.GetText(i,strTmp);
InFile.WriteString(strTmp+"\n");
}
//..关闭文件
InFile.Close();
}