Start MDI application with no empty document 
Author Message
 Start MDI application with no empty document

I've just created a MDI Application with wizard. When
executed the application starts with a new empty document
as MDI child. How can i avoid this, in order to open the
application with just the MDI's MainFrame ?

--A.O.



Sat, 07 Feb 2004 23:44:04 GMT  
 Start MDI application with no empty document
In CMyProgramApp::InitInstance there is code to parse the command line and
do whatever action is required:

 CCommandLineInfo cmdInfo; // declare it
 ParseCommandLine(cmdInfo); // fill the stucture with whatever is on the
command line

 // Dispatch commands specified on the command line
 if (!ProcessShellCommand(cmdInfo)) return FALSE;

The problem is that this assumes that if you start up weith no args you want
to start a new document.
Correct this by saying

 CCommandLineInfo cmdInfo; // declare it
 ParseCommandLine(cmdInfo); // fill the stucture with whatever is on the
command line

if (cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew)
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;

 // Dispatch commands specified on the command line
 if (!ProcessShellCommand(cmdInfo)) return FALSE;

This prevents new from being called on startup.

best regards,

John M I Davis


Quote:

> I've just created a MDI Application with wizard. When
> executed the application starts with a new empty document
> as MDI child. How can i avoid this, in order to open the
> application with just the MDI's MainFrame ?

> --A.O.



Sun, 08 Feb 2004 02:52:30 GMT  
 Start MDI application with no empty document
Thanks, your hint works perfectly.

Quote:
>-----Original Message-----
>In CMyProgramApp::InitInstance there is code to parse the
command line and
>do whatever action is required:

> CCommandLineInfo cmdInfo; // declare it
> ParseCommandLine(cmdInfo); // fill the stucture with
whatever is on the
>command line

> // Dispatch commands specified on the command line
> if (!ProcessShellCommand(cmdInfo)) return FALSE;

>The problem is that this assumes that if you start up

weith no args you want
Quote:
>to start a new document.
>Correct this by saying

> CCommandLineInfo cmdInfo; // declare it
> ParseCommandLine(cmdInfo); // fill the stucture with
whatever is on the
>command line

>if (cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew)
>    cmdInfo.m_nShellCommand =

CCommandLineInfo::FileNothing;
Quote:

> // Dispatch commands specified on the command line
> if (!ProcessShellCommand(cmdInfo)) return FALSE;

>This prevents new from being called on startup.

>best regards,

>John M I Davis



>> I've just created a MDI Application with wizard. When
>> executed the application starts with a new empty
document
>> as MDI child. How can i avoid this, in order to open the
>> application with just the MDI's MainFrame ?

>> --A.O.

>.



Sun, 08 Feb 2004 16:20:29 GMT  
 Start MDI application with no empty document
Thanks, your hint works perfectly.

Quote:
>-----Original Message-----
>In CMyProgramApp::InitInstance there is code to parse the
command line and
>do whatever action is required:

> CCommandLineInfo cmdInfo; // declare it
> ParseCommandLine(cmdInfo); // fill the stucture with
whatever is on the
>command line

> // Dispatch commands specified on the command line
> if (!ProcessShellCommand(cmdInfo)) return FALSE;

>The problem is that this assumes that if you start up

weith no args you want
Quote:
>to start a new document.
>Correct this by saying

> CCommandLineInfo cmdInfo; // declare it
> ParseCommandLine(cmdInfo); // fill the stucture with
whatever is on the
>command line

>if (cmdInfo.m_nShellCommand = CCommandLineInfo::FileNew)
>    cmdInfo.m_nShellCommand =

CCommandLineInfo::FileNothing;
Quote:

> // Dispatch commands specified on the command line
> if (!ProcessShellCommand(cmdInfo)) return FALSE;

>This prevents new from being called on startup.

>best regards,

>John M I Davis



>> I've just created a MDI Application with wizard. When
>> executed the application starts with a new empty
document
>> as MDI child. How can i avoid this, in order to open the
>> application with just the MDI's MainFrame ?

>> --A.O.

>.



Sun, 08 Feb 2004 16:20:24 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Start-Up MDI app without opening empty document

2. Starting MDI application with empty frame

3. MS-C++6.0: Starting without empty document

4. MS-C++6.0: Starting without empty document

5. DocView Application without empty document

6. Don't Open New Document when starting a MDI app

7. start MDI without Document

8. Help! Start MDI app without document

9. Hiding an MDI Child Window when application starts

10. Opening a document, while preventing the application from starting a second instance

11. Starting a CView from an MDI Application

12. How to start an application without invoking a document

 

 
Powered by phpBB® Forum Software