Solved

No document at startup

Posted on 1998-12-04
2
156 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
Comment Utility
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
Comment Utility
thanks stsanz
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video discusses moving either the default database or any database to a new volume.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now