Solved

No document at startup

Posted on 1998-12-04
2
161 Views
Last Modified: 2013-11-20
I am doing one MDI with multiple documents types application.
The framework activates one window to choose the document
to open. That is fine during the new command but i don´t want to have this window every times the application starts.
In fact i would like to start the application without creating any document.
How can i do it?
0
Comment
Question by:jmartins71
2 Comments
 
LVL 6

Accepted Solution

by:
stsanz earned 20 total points
ID: 1325760
If you created your MDI application with AppWizard, you should have the following lines in your CWinApp::InitInstance function :

// 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;

To prevent MFC to open a new MDI child window on app start, add the following two lines :

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

For more info, check "m_nShellCommand" online help.

0
 

Author Comment

by:jmartins71
ID: 1325761
thanks stsanz
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
pre4 challenge 19 110
zeroMAx challenge 20 124
Trying to run powershell  in a batch file. How do I do this? 8 114
Message not shown 5 82
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question