I'm implementing an advanced CFileDialog. I intend to run it a few times by a while loop. I initialize the "File Of Type" combo fieldto 4 optioins which I set their order. The user can pick one of the options, and after the user clicks OK I would like the field he picked to be the first option when the CFileDialog will be activated again. how do I save the preference of the box in the most elegant way?
an example will explain better:
CString aStr = _T("(*.a)|*.a|(*.b)|*.b|(*.c)|*.c|(*.d)|*.d||")
// aStr filters the "file of type"
CFileDialog aFileDlg(TRUE, NULL , NULL, OFN_ALLOWMULTISELECT, aStr);
if (aFileDlg.DoModal() == IDOK)
}// end of while
the active option in the combo will be *.a, because this is what I initialized, but if the user picks *.b and clicked OK, I'd like it to be the active option in the next time CFileDialog is activated.
my intension was to keep the "File Of Type" data inside a singleton class. what should I do?