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