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. Multiple doc templates problem

Multiple doc templates problem

Scheduled Pinned Locked Moved C / C++ / MFC
wpfhelpquestion
3 Posts 3 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.
  • C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #1

    I'm working on a paint program, and want my File|Open dialog to allow loading of jpg, bmp, ( NOT gif, if UNISYS is watching ;o) ) so I have created multiple document templates. The problem now is that when I click File|New I get asked what sort of document I want to create. Can anyone suggest a way to get around this problem ? I've tried overriding OnFileOpen in the Document class, but that works only AFTER the first file has been loaded or created. Thanks Christian

    M M 2 Replies Last reply
    0
    • C Christian Graus

      I'm working on a paint program, and want my File|Open dialog to allow loading of jpg, bmp, ( NOT gif, if UNISYS is watching ;o) ) so I have created multiple document templates. The problem now is that when I click File|New I get asked what sort of document I want to create. Can anyone suggest a way to get around this problem ? I've tried overriding OnFileOpen in the Document class, but that works only AFTER the first file has been loaded or created. Thanks Christian

      M Offline
      M Offline
      Mike Dunn
      wrote on last edited by
      #2

      You should override CWinApp::OnFileNew(). MFC technical note 22 has a little bit about this.

      1 Reply Last reply
      0
      • C Christian Graus

        I'm working on a paint program, and want my File|Open dialog to allow loading of jpg, bmp, ( NOT gif, if UNISYS is watching ;o) ) so I have created multiple document templates. The problem now is that when I click File|New I get asked what sort of document I want to create. Can anyone suggest a way to get around this problem ? I've tried overriding OnFileOpen in the Document class, but that works only AFTER the first file has been loaded or created. Thanks Christian

        M Offline
        M Offline
        Masaaki Onishi
        wrote on last edited by
        #3

        Hello, codeguru around the world. Visual C++ 4 HOW-TO by Scott Stanfield with Ralph Arvesen has something to resolve this answer. I just write the sentense as it is. 4) Add a string resource. Using App Studio, make a copy of the existing string resource IDR_LINESTYPE and change the ID to IDR_DEBUGTYPE. The caption for the IDR_DEBUGTYPE is not identical to IDR_LINESTYPE. Modify it and remove the second, "Lines" to prevent the framework from thinking we have more than one document type. Otherwise, you would end up with the dialog box - the unwanted file new dialog box. Good luck for your project. -Masaaki Onishi-

        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