Click to See Complete Forum and Search --> : "Permanent" data storage?


EvanPlett
February 22nd, 2010, 08:44 PM
I am writing a program that has many variables, probably 40ish of them, ranging from booleans to colors to time. I need to be able to save these variables so that when the user reopens the program they can reload the data. I have tried using the writepriviteprofileint type methods, but that method is get very cumbersome due to the amount of info I need to store. I know that in Java you can just like save a class, is there anything similar to that in C++ or any other good way to store a bunch of different variables. I am using a shared memory class to save all of my variables. If it matters, I am using the MFC library for my visual stuff.

Thanks,
Evan Plett

Arjay
February 22nd, 2010, 10:27 PM
In MFC, you can use serialization with the CArchive class. You can also save the data to an xml file.

EvanPlett
February 23rd, 2010, 12:19 PM
Thanks, I think that is exactly what I was looking for.