标题:如何用CArchive 保存数据??追加的方式!!
只看楼主
tsyking
Rank: 2
等 级:论坛游民
帖 子:23
专家分:50
注 册:2007-6-12
结帖率:100%
 问题点数:0 回复次数:2 
如何用CArchive 保存数据??追加的方式!!
程序代码:
    CFile f;
    f.Open("1.txt",CFile::modeCreate|CFile::modeWrite);
    f.SeekToEnd();
    CArchive ar(&f,CArchive::store);
    

    ar<<s_strs;
    ar.Close();
    f.Close();
搜索更多相关主题的帖子: store 如何 
2011-06-30 15:31
tsyking
Rank: 2
等 级:论坛游民
帖 子:23
专家分:50
注 册:2007-6-12
得分:0 
f.Open("1.txt",CFile::modeCreate|CFile::modeWrite);

不应该用modecreat模式的,

  www . vckf  .net   专业的VC开发网站
2011-06-30 15:37
tsyking
Rank: 2
等 级:论坛游民
帖 子:23
专家分:50
注 册:2007-6-12
得分:0 
给个判断,
程序代码:
CFile f;
    if(!f.Open("1.txt",CFile::modeWrite)){
        f.Open("1.txt",CFile::modeCreate|CFile::modeWrite);
        MessageBox("文件不存在,将创建!");}

    f.SeekToEnd();
    CArchive ar(&f,CArchive::store);

  www . vckf  .net   专业的VC开发网站
2011-07-02 14:12



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-344395-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.438872 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved