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. Default Document Open

Default Document Open

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • R Offline
    R Offline
    Ryan B
    wrote on last edited by
    #1

    Im writing an MDI app, and I dont want the application to create / show a blank document when the application starts. I know that ProcessShellCommand calls either OnFileNew or OpenDocumentFile (depending on wether a file was specified in the command line). What can I do? Ryan Baillargeon Software Specialist Fuel Cell Technologies Inc.

    T 1 Reply Last reply
    0
    • R Ryan B

      Im writing an MDI app, and I dont want the application to create / show a blank document when the application starts. I know that ProcessShellCommand calls either OnFileNew or OpenDocumentFile (depending on wether a file was specified in the command line). What can I do? Ryan Baillargeon Software Specialist Fuel Cell Technologies Inc.

      T Offline
      T Offline
      TyMatthews
      wrote on last edited by
      #2

      In your app's InitInstance, you should see some code like this:

      // Parse command line for standard shell commands, DDE, file open
      CCommandLineInfo cmdInfo;
      ParseCommandLine(cmdInfo);
       
      // Dispatch commands specified on the command line
      if (!ProcessShellCommand(cmdInfo))
          return FALSE;
      

      Add this line to it:

      // Parse command line for standard shell commands, DDE, file open
      CCommandLineInfo cmdInfo;
      ParseCommandLine(cmdInfo);
       
      cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
       
      // Dispatch commands specified on the command line
      if (!ProcessShellCommand(cmdInfo))
          return FALSE;
      

      By default, m_nShellCommand is set to FileNew, which creates a new document for you automatically when the app starts.

      Ty

      "The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein

      R 1 Reply Last reply
      0
      • T TyMatthews

        In your app's InitInstance, you should see some code like this:

        // Parse command line for standard shell commands, DDE, file open
        CCommandLineInfo cmdInfo;
        ParseCommandLine(cmdInfo);
         
        // Dispatch commands specified on the command line
        if (!ProcessShellCommand(cmdInfo))
            return FALSE;
        

        Add this line to it:

        // Parse command line for standard shell commands, DDE, file open
        CCommandLineInfo cmdInfo;
        ParseCommandLine(cmdInfo);
         
        cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
         
        // Dispatch commands specified on the command line
        if (!ProcessShellCommand(cmdInfo))
            return FALSE;
        

        By default, m_nShellCommand is set to FileNew, which creates a new document for you automatically when the app starts.

        Ty

        "The significant problems we face cannot be solved at the same level of thinking we were at when we created them." -Albert Einstein

        R Offline
        R Offline
        Ryan B
        wrote on last edited by
        #3

        Perfect Thanks... Ryan Baillargeon Software Specialist Fuel Cell Technologies Inc.

        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