I am writing simple C++ dialog based MFC application. It has several inputs, checkboxes, time selects. As a part of it’s functionality it should have Save and Load buttons which would save/restore state of those elements. For example text in input, if some elements are disabled or not, their values.
The question is – what is the right approach to do it? The most simple and direct one would be to save values in a specific order (say text1,text2,checkbox1_state,time_select1) and then in the same order restore them one by one.
Are there other options? I don’t want to use some other libraries (saw Boost is mentioned frequently in terms of serialization).
MFC has a CArchive class you could consider using for serialization of controls or dialogs. You could also roll your own serialization with file streams.