Home > Software engineering >  How to make a MFC control application program exits, the content of the changes can be saved in file
How to make a MFC control application program exits, the content of the changes can be saved in file

Time:09-24

CodePudding user response:

Mainly put your data is extracted, and then write files, read files

CodePudding user response:

Is to read and write files, the program runs, load the file, and displayed on the interface, the interface changes in written to the file at the same time

CodePudding user response:

CWinApp: : WriteProfileString, etc...

CodePudding user response:

Search "MFC serialization deserialization." "

CodePudding user response:


This is known as serialization, you put the kind of data storage, serialization and deserialization, store/load

CodePudding user response:

Do a timer, every once in a while to save to save the data

CodePudding user response:

Is to read and write files to operation

CodePudding user response:

Upstairs has given positive solution,
1. Read and write files
2. The serialization

CodePudding user response:

WriteProfileString can completely meet your needs above the
XX you the name of the class: : InitInstance () used in the WriteProfileString read ini/TXT file
With the need to update the data in oncancel WriteProfileString written to a file

CodePudding user response:

references 9 f shiyanbo_1006 response:
WriteProfileString can completely meet your needs above the
XX you the name of the class: : InitInstance () used in the WriteProfileString read ini/TXT file
With the need to update the data in oncancel WriteProfileString wrote file


This can be, is a read/write operation, the program exits data written to a file, program start initialization and then read it out, if the data volume small, namely dialog box on the control input value to automatically save, when open the program and return to the last closing time value, in this case you can write registries to, open and read it again

CodePudding user response:

This may help you: CIniRw class, used to read and write the suffix for ini configuration file,
https://blog.csdn.net/sunriver2000/article/details/79779880
  • Related