MRU file problem
Mercea Mario -- mario@edc.sorostm.ro
Wednesday, July 10, 1996
>1. Start wordpad
>2. Open four different files and verify they show up in the four most
>recent file list.
>3. edit the file you have open (do not save).
>4. Select a file from the four most recent file list.
>5. Select Cancel when prompted to save the file you just edited.
>Now when you go back to the four most recent list, the file you opened
>will no longer be there.
You can use the undocumented function CRecentFileList from CWinApp,
override OnOpenDocument and check if the active document IsModified,
then do yourself a message box, asking: Save? (YES/NO/CANCEL), if
cancel then Remove it from recent file list.
void CRecentFileList::Add(LPCTSTR lpszPathName);
void CRecentFileList::Remove(int nIndex);
more information about CRecentFileList you can find in /MFC/SRC/filelist.cpp
the second way you can do this is to change MRU files direct in your
.INI file, then call: void CRecentFileList::ReadList() to update
changes...
PS: This is not the best solution, it's just an idea.
Mercea Mario -- mario@edc.sorostm.ro
Wednesday, July 10, 1996
>1. Start wordpad
>2. Open four different files and verify they show up in the four most
>recent file list.
>3. edit the file you have open (do not save).
>4. Select a file from the four most recent file list.
>5. Select Cancel when prompted to save the file you just edited.
>Now when you go back to the four most recent list, the file you opened
>will no longer be there.
You can use the undocumented function CRecentFileList from CWinApp,
override OnOpenDocument and check if the active document IsModified,
then do yourself a message box, asking: Save? (YES/NO/CANCEL), if
cancel then Remove it from recent file list.
void CRecentFileList::Add(LPCTSTR lpszPathName);
void CRecentFileList::Remove(int nIndex);
more information about CRecentFileList you can find in /MFC/SRC/filelist.cpp
the second way you can do this is to change MRU files direct in your
.INI file, then call: void CRecentFileList::ReadList() to update
changes...
PS: This is not the best solution, it's just an idea.
| Вернуться в корень Архива
|