将reportstyle listcontrol保存在文本文件中。 [英] Save reportstyle listcontrol in text file.

查看:80
本文介绍了将reportstyle listcontrol保存在文本文件中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..我如何在一个文本文件中保存报表样式listcontrol并在以后检索它。



在listcontrol中,一些列设置为编辑框,一些列设置作为组合框架。



如何访问listcontrol元素并将该元素归档以便稍后加载。



任何帮助,评论,建议都是appriciated..Thanks。

Hi..How I can save report style listcontrol in a text file and retrive it later.

In listcontrol some columns set as edit boxses and some columns set as comboboxses.

How i can access the listcontrol element and archive that element to load later.

any help, comment, suggestions are appriciated..Thanks.

推荐答案

要使它成为真正的MFC,你需要进行listcontrol 可序列化的 [ ^ ]。



什么根据微软的意思是:

To make it truly MFC you would need to make your listcontrol serializable[^].

What it means according to Microsoft is:
引用:

序列化是写入或读取对象的过程持久存储介质,例如磁盘文件。序列化非常适用于在程序执行期间或之后需要维护结构化数据(如C ++类或结构)状态的情况。使用MFC提供的序列化对象允许以标准和一致的方式进行此操作,从而使用户无需手动执行文件操作。

Serialization is the process of writing or reading an object to or from a persistent storage medium such as a disk file. Serialization is ideal for situations where it is desired to maintain the state of structured data (such as C++ classes or structures) during or after execution of a program. Using the serialization objects provided by MFC allows this to occur in a standard and consistent manner, relieving the user from the need to perform file operations by hand.





使对象可序列化是一个非常简单的过程(参见上面的链接)。但是,您必须定义<<和>>操作员来往往读取CArchive。在这里,您必须定义文档结构。



首先想到的是使用以逗号分隔的文件 CSV [ ^ ]。通过这种方式,您还可以让用户通过Excel打开和查看文件。



但是,如果您的listcontrol中的值包含逗号或换行符时,必须引用这些值。请参见此处 [ ^ ]了解更多详情



Making the object serializable is a very simple process (see the link above). However, you would have to define << and >> operators to read to/fro CArchive. Here, where you will have to define the document structure.

First thing that comes to mind is to use a comma-separated file CSV[^]. By doing it this way you also provide an ability to the users to open and view the files via Excel.

However, if you have values in your listcontrol with commas or line breaks, the values would have to be quoted. See here[^] for more details


这篇关于将reportstyle listcontrol保存在文本文件中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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