帮我看下,谢谢大家了

解决方案 »

  1.   

    CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite
      

  2.   

    CFile::modeNoTruncate   Combine this value with modeCreate. If the file being created already exists, it is not truncated to 0 length. Thus the file is guaranteed to open, either as a newly created file or as an existing file. This might be useful, for example, when opening a settings file that may or may not exist already. This option applies to CStdioFile as well.
      

  3.   

    CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite
    这3个都加进去吗?我试了,不行啊.
    能具体点吗?
      

  4.   

    CStdioFile ff("e:\haha",CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite);
      

  5.   

    if(ff.Open("d:\\1.txt",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite,&mExcept))
      
       ff.WriteString(st);
       ff.WriteString("\n");
          ff.Close();这是在一个对话框里的。
    我下次打开对话框在输入,就覆盖了
      

  6.   

    if(ff.Open("d:\\1.txt",CFile::modeCreate|CFile::modeNoTruncate|CFile::modeWrite,&mExcept))
      ff.SeekToEnd();
       ff.WriteString(st);
       ff.WriteString("\n");
          ff.Close();
      

  7.   

    强,谢谢 seu07201213(汪洋中的一片叶子)
    谢谢大家。