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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Opening a document (MDI)

Opening a document (MDI)

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 2 Posters 1 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.
  • V Offline
    V Offline
    vasanth1004
    wrote on last edited by
    #1

    I want to open a document from within my CDocument derived class (MDI App). How do I do this? From what I've read when I was trying to solve this, CWinApp calls CDocManager, which then uses CDocTemplate, and then OnOpenDocument. But, how do I do all this from within my CMyDoc class? Thanks

    J 1 Reply Last reply
    0
    • V vasanth1004

      I want to open a document from within my CDocument derived class (MDI App). How do I do this? From what I've read when I was trying to solve this, CWinApp calls CDocManager, which then uses CDocTemplate, and then OnOpenDocument. But, how do I do all this from within my CMyDoc class? Thanks

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      Try with this:

      AfxGetApp()->OpenDocumentFile(lpszFileName);

      -- jlr http://jlamas.blogspot.com/[^]

      V 1 Reply Last reply
      0
      • J Jose Lamas Rios

        Try with this:

        AfxGetApp()->OpenDocumentFile(lpszFileName);

        -- jlr http://jlamas.blogspot.com/[^]

        V Offline
        V Offline
        vasanth1004
        wrote on last edited by
        #3

        This doesn't work, I just get a debug assertion. Any other ideas?

        J 1 Reply Last reply
        0
        • V vasanth1004

          This doesn't work, I just get a debug assertion. Any other ideas?

          J Offline
          J Offline
          Jose Lamas Rios
          wrote on last edited by
          #4

          vasanth1004 wrote: This doesn't work, I just get a debug assertion. Any other ideas? What about breaking with the debugger at the debug assertion, looking at the variables and call stack, and determining what assertion is failing and why? -- jlr http://jlamas.blogspot.com/[^]

          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