Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC: Most recently used (MRU) files

MFC: Most recently used (MRU) files

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialarchitecturehelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13219589
    wrote on last edited by
    #1

    Microsoft Visual C++ 2019. Windows 10, using MFC Is there a nice step by step example of code showing how to use the MRU in a standard SDI application with ribbon and without document/view architecture? My used files (*.jpg, *.bmp) are well stored in the MRU file list of the main menu of the ribbon. But when I click on one of them I have an error in .../MFC/appui.cpp showing that ENSURE_VALID(m_pDocManager) failed, which is normal because I did not choose doc/view support. Is there any way out, unless completely rewriting a new project with pDocManager? Pierre

    V 1 Reply Last reply
    0
    • U User 13219589

      Microsoft Visual C++ 2019. Windows 10, using MFC Is there a nice step by step example of code showing how to use the MRU in a standard SDI application with ribbon and without document/view architecture? My used files (*.jpg, *.bmp) are well stored in the MRU file list of the main menu of the ribbon. But when I click on one of them I have an error in .../MFC/appui.cpp showing that ENSURE_VALID(m_pDocManager) failed, which is normal because I did not choose doc/view support. Is there any way out, unless completely rewriting a new project with pDocManager? Pierre

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      You should handle the commands opening the files from MRU list in your own CWinApp derived class. Here you could then open the files without using pDocManager. See the example in [Q243751: HOWTO: Add Command Handlers for MRU Menu Items in MFC App | KnowledgeBase Archive](https://jeffpar.github.io/kbarchive/kb/243/Q243751/)

      U 1 Reply Last reply
      0
      • V Victor Nijegorodov

        You should handle the commands opening the files from MRU list in your own CWinApp derived class. Here you could then open the files without using pDocManager. See the example in [Q243751: HOWTO: Add Command Handlers for MRU Menu Items in MFC App | KnowledgeBase Archive](https://jeffpar.github.io/kbarchive/kb/243/Q243751/)

        U Offline
        U Offline
        User 13219589
        wrote on last edited by
        #3

        Works fine. Thanks Piere

        V 1 Reply Last reply
        0
        • U User 13219589

          Works fine. Thanks Piere

          V Offline
          V Offline
          Victor Nijegorodov
          wrote on last edited by
          #4

          You are welcome! :) :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups