Solved

No document at startup

Posted on 1998-12-04
2
160 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 80
java ^ examples 8 69
Not needed 13 119
Making an alias 7 101
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 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