I have an MFC C++ application, which has a CFileDialog. I call its DoModal function to open a file browse window. I set the lpstrInitialDir, to tell it where to open the dialog at the first time
CString defaultDir = L"C:\\tmp\\";
CFileDialog d(TRUE);
d.m_ofn.lpstrInitialDir = defaultDir ;
if( d.DoModal ()==IDOK )
{... app logic after the file was seslected...}
The problem is I would like my program to remember the user selection. Next time the user runs my app, I would like my DoModal filebrowse dialog to open at the location, from which the user selected the file at his last use.
How can I do it?
I saw there is LastVisitedMRU Registry key, nut I couldn't find any example how to properly use it with the CFileDialog.DoModal
Thanks a lot!