如何在C ++中打开一个空文本文件 [英] How can I open an empty text file in C++

查看:125
本文介绍了如何在C ++中打开一个空文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我正在为实验室实验设计GUI。 GUI使用VC ++ 6显示来自硬件设备的一些读数,我需要打开一个空文本文件作为实验者的笔记本。



如何打开一个空文本文件或像(Word)这样的应用程序作为笔记本。



我尝试了什么:



我添加了一个名为IDM_NOTE的按钮和一个名为ONnotebook的功能



Hi

I am designing a GUI for a lab experiment. The GUI displays some reading coming from a hardware device using VC++ 6 and I need to open an empty text file as a notebook for the experimenter.

How can i open an empty text file or an app like (Word) as a notebook.

What I have tried:

I added a button called IDM_NOTE and a funciton called ONnotebook

void CVCDlg::ONnotebook() //open NoteBook 
{

    //Open NoteBook
	
}

推荐答案

您可以使用append选项打开现有文件以添加更多信息。如果文件不存在,则只需使用create for writing选项。 CFile的文档,以及open,fopen和CreateFile提供了完整的详细信息。
You can open an existing file with the append option to add more information. If the file does not exist then just use the create for writing option. The documentation for CFile, and also open, fopen and CreateFile gives full details.


这篇关于如何在C ++中打开一个空文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆