You are here:

C++/Apply the new setting.


I use visual c++ 6.

In my software currently have opptions to give  page setup using values. Currently opening  the page setup dialog it takes defalt values and I can change those values. Eg. top=20; left=20; bottom=20, right=20 .

But i need, when I change those values to another value eg. top= 34, left=4; bottom=54, right=20  and save it, exit the software and oppening the software again in another time, it should be take values in lastly given values. eg top= 34, left=4; bottom=54, right=20. How I do that.

How to save apply changes when software opening again.

Thanks for your considerations.  

yasanka , Thank you for your question.

There are many ways to make data persist between program sessions.

One way is to write functions that write various types of values into a file. You could write them in binary or, as I do, write them in hexadecimal separated by commas.

Another way is to use a Profile or Initialization file (.ini). Windows has functions to write and read such a file.

Another way is to use MFC and write Serialization functions.

David Spector


All Answers

Answers by Expert:

Ask Experts


David Spector


Highly knowledgeable in the C++ language, Visual C++ (MSVC), Windows API, documentation and other quality-assurance techniques, and debugging. Knowledgeable in MFC, COM, GUI design, and object-oriented design.


I have been a software engineer since 1965. I have been published. My specializations have been: biomedical programming, compiler implementation, and many kinds of Windows programming. I don't do Databases or other business-oriented stuff.

Windows?/DOS Developer's Journal, ACM SIGPLAN Notices, and Computer Science Press.

ICCP Systems Programming Certification
Master's degree equivalent in Computer Science

©2017 All rights reserved.