在“确定”按钮的响应函数里首先取出"文本框"中的数据
         CStdioFile file;
file.Open("text.txt",CFile::modeWrite|CFile::typeText);
file.WriteString(st);
file.Close();在“退出”按钮的响应函数里: AfxMessageBox("是否确认退出");

解决方案 »

  1.   

    首先谢谢你,不过按你的方法通过编译后,运行会出现此类错误:
    Debug Assertion Failed!
    .................
    Flile:filetxt.cpp
    line:167For information on how yout program can cause an assertion
    failure,see the the Visual C++ documentation on asserts
    (Press Retry debug the application)
      

  2.   

    HF_99() 楼楼上,正解.
    不过要注意,
    file.Open("text.txt",CFile::modeWrite|CFile::typeText);
    test.txt是相对路径.如果要指定路径,需要写绝对路径
      

  3.   

    首先谢谢你,不过按你的方法通过编译后,运行会出现此类错误:
    Debug Assertion Failed!
    .................
    Flile:filetxt.cpp
    line:167For information on how yout program can cause an assertion
    failure,see the the Visual C++ documentation on asserts
    (Press Retry debug the application)-------------------------------------------------------------------------------
    不是我给你的代码引起的。
    这个错误好象是说断言函数检查失败。看看是不是你的哪个变量值不合理