Click here to Skip to main content
11,702,168 members (65,459 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC
Is it normal behavior for the ID_FILE_MRU_FILEn messages to be handled in the document class (where they seem to work fine), but not the CMainFrame class (where they do not work - at least in my app)?
Posted 10-Feb-11 6:21am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

A quick search of the MFC codebase with ID_FILE_MRU shows that these messages are handled by the CWinApp class.

This maps the command range of ID_FILE_MRU_FILE1..16 to the same function OnOpenRecentFile.

It appears to be teh document object that handles the command because the application object just sends the file to the DocTemplate list, finds the template which can handle the document type (if any) and tries to open it.

The mainframe is never involved in any of these steps.

So I am not too sure what your problem is, can you add any additional details?
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 395
1 Sergey Alexandrovich Kryukov 355
2 OriginalGriff 314
3 CHill60 145
4 Mika Wendelius 119
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,507
2 CPallini 4,922
3 Maciej Los 4,371
4 Mika Wendelius 3,556


Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 15 Feb 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100