MFC: List of most recently used doesn't show up in the menu (aka some terribly stupid bug I'm doing)

408 views Asked by At

This makes me feel bad about myself: I can't convince the MRU list to show up in my MFC app's menu despite the fact that I'm doing all the same things that I did with my last project in which I used it, that is:

(a) loading the MRU by LoadStdProfileSettings() in CWinApp::InitInstance,

BOOL CEditor::InitInstance(){
    if (!CWinApp::InitInstance()) return FALSE;
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    if (!ProcessShellCommand(cmdInfo)) return FALSE;
    LoadStdProfileSettings(); // begging you, do something!
    m_pMainWnd->ShowWindow(SW_SHOW);
    m_pMainWnd->UpdateWindow();
    return TRUE;
}

and (b) adding each loaded/saved file into the MRU list in CDocument::Serialize

void CDrive::Serialize(CArchive &ar){
    // serialization
    // - add to the MRU
    CFile *f=ar.GetFile();
    CString fileName=f->GetFileName();
    extern CEditor editor;
    editor.AddToRecentFileList(fileName);
    // - i/o
    // ...do the main objective...
}

As pinpointed in the title, must be something terribly stupid which I've been overlooking.

Really many thanks for any helphing hand.

Tomas

0

There are 0 answers