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. mdi help

mdi help

Scheduled Pinned Locked Moved C / C++ / MFC
questionwpfhelp
6 Posts 4 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.
  • M Offline
    M Offline
    Michael Shuster
    wrote on last edited by
    #1

    I have a question, obviously, I have a MDI application with three different document templates. I simply want to launch a specific one from a menu option. How would one go about launching a certain document/view? Thanks Michael Shuster the 1st

    A 1 Reply Last reply
    0
    • M Michael Shuster

      I have a question, obviously, I have a MDI application with three different document templates. I simply want to launch a specific one from a menu option. How would one go about launching a certain document/view? Thanks Michael Shuster the 1st

      A Offline
      A Offline
      AlexO
      wrote on last edited by
      #2

      CMultiDocTemplate::OpenDocumentFile

      M 1 Reply Last reply
      0
      • A AlexO

        CMultiDocTemplate::OpenDocumentFile

        M Offline
        M Offline
        Michael Shuster
        wrote on last edited by
        #3

        I acutally got that far, I jsut do not know what to use for a parameter. It is asking for a path name string but i want to load a template. Forgive me if I am missing something obvious

        C 1 Reply Last reply
        0
        • M Michael Shuster

          I acutally got that far, I jsut do not know what to use for a parameter. It is asking for a path name string but i want to load a template. Forgive me if I am missing something obvious

          C Offline
          C Offline
          Chris Richardson
          wrote on last edited by
          #4

          Call CDocTemplate::OpenDocumentFile and pass it NULL. The MSDN says this causes it to create a new document. Chris Richardson C/C++ Include Finder[^]

          M 1 Reply Last reply
          0
          • C Chris Richardson

            Call CDocTemplate::OpenDocumentFile and pass it NULL. The MSDN says this causes it to create a new document. Chris Richardson C/C++ Include Finder[^]

            M Offline
            M Offline
            Michael Shuster
            wrote on last edited by
            #5

            hmmm, that did not seem to work. I can not pass it the value of Null. It returns the following error: error C2512: 'CDocTemplate' : no appropriate default constructor available Plus I want to actually pick which document templat opens. I have three, and I want a specific one to open. Any other suggestions or maybe you could refer me to where you read that at.

            R 1 Reply Last reply
            0
            • M Michael Shuster

              hmmm, that did not seem to work. I can not pass it the value of Null. It returns the following error: error C2512: 'CDocTemplate' : no appropriate default constructor available Plus I want to actually pick which document templat opens. I have three, and I want a specific one to open. Any other suggestions or maybe you could refer me to where you read that at.

              R Offline
              R Offline
              Roger Allen
              wrote on last edited by
              #6

              Sounds like you need to make use of the undocumented MFC class CDocManager. When you call AddDocTemplate() in InitInstance(), the template pointer is handed off to the m_pDocManager object, which is part of your CWinApp object. You can use this to iterate the CDocTemplates registered in your application and call OpenDocumentFile(NULL) on your CMultiDocTemplate object. This should create an empty document of the required type. See MFC files DOCMULTI.CPP line 114 and DOCSINGL.CPP line 88 for the functions in question. Roger Allen Sonork 100.10016 WHats brown and sticky? A stick or some smelly stuff!

              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