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. Doc/View Questions

Doc/View Questions

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
2 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 6688
    wrote on last edited by
    #1

    Hi everybody, when my doc/view app starts, the Framework does a call to OnNewDocument if no document is specified on the commandline. I would like to change this. What I'd like to do is to open a document. For this purpose I've created a dialog similar to the dialog that pops up if you start Visual Basic (provided you use the default config). The user can choose whether to open a recently used file, browse for a file or create a new file. How do I get started with this one? Any help is greatly appreceated. Matthias

    M 1 Reply Last reply
    0
    • U User 6688

      Hi everybody, when my doc/view app starts, the Framework does a call to OnNewDocument if no document is specified on the commandline. I would like to change this. What I'd like to do is to open a document. For this purpose I've created a dialog similar to the dialog that pops up if you start Visual Basic (provided you use the default config). The user can choose whether to open a recently used file, browse for a file or create a new file. How do I get started with this one? Any help is greatly appreceated. Matthias

      M Offline
      M Offline
      Masoud Samimi
      wrote on last edited by
      #2

      If mean you don't want the default document to load on startup, then this is the code:

         // Parse command line for standard shell commands, DDE, file open
      CCommandLineInfo cmdInfo;
      ParseCommandLine(cmdInfo);
      
         // ADD THIS LINE RIGHT HERE! ( AFTER the above lines!)
      cmdInfo.m\_nShellCommand = CCommandLineInfo::FileNothing;
      

      Add it in the InitInstance() of your apps class, and then make your selection dialog load and prompt user to select whatever they wanted! :) "Socrates is a man. All men are mortal. Therefore Socrates is mortal." -- Aristotle (syllogism) Cheers Masoud Samimi Go!

      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