MS-C++6.0: Starting without empty document 
Author Message
 MS-C++6.0: Starting without empty document

Hi,
I want my application to start WITHOUT an empty document.
What do I have to change in the standard MDI-Project created by the
applicationWizard ?

-------------->  Raimund  ---------------->



Sat, 08 Sep 2001 03:00:00 GMT  
 MS-C++6.0: Starting without empty document
Override OnopenDocument() and call the doc you want
and not call Delete()
Quote:

>Hi,
>I want my application to start WITHOUT an empty document.
>What do I have to change in the standard MDI-Project created by the
>applicationWizard ?

>-------------->  Raimund  ---------------->



Sat, 08 Sep 2001 03:00:00 GMT  
 MS-C++6.0: Starting without empty document
The more usual method I have come across is
to use

 // Do not create an empty document window at Startup
 if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew)
  cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;

in your InitInstance();

Andy

Quote:

>Override OnopenDocument() and call the doc you want
>and not call Delete()


>>Hi,
>>I want my application to start WITHOUT an empty document.
>>What do I have to change in the standard MDI-Project created by the
>>applicationWizard ?

>>-------------->  Raimund  ---------------->



Sat, 08 Sep 2001 03:00:00 GMT  
 MS-C++6.0: Starting without empty document
Look at the related help for ProcessShellCommand if you are using MSVC 6.0.
Following is the excerpts.

CCommandLineInfo::FileNothing   Turns off the display of a new MDI child
window on startup. By design, AppWizard generated MDI applications display a
new child window on startup. To turn off this feature, an application can
use CCommandLineInfo::FileNothing as the shell command when calling
ProcessShellCommand. ProcessShellCommand is called by the InitInstance( ) of
all CWinApp derived classes.
Example

BOOL CMyWinApp::InitInstance()
{
...
// Parse command line for standard shell commands, DDE, file open
   CCommandLineInfo cmdInfo;
   ParseCommandLine(cmdInfo);
// DON'T display a new MDI child window during startup!!!
   cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
// Dispatch commands specified on the command line
   if (!ProcessShellCommand(cmdInfo))
      return FALSE;
...

Quote:
};

>Override OnopenDocument() and call the doc you want
>and not call Delete()


>>Hi,
>>I want my application to start WITHOUT an empty document.
>>What do I have to change in the standard MDI-Project created by the
>>applicationWizard ?

>>-------------->  Raimund  ---------------->



Sat, 08 Sep 2001 03:00:00 GMT  
 MS-C++6.0: Starting without empty document
Thanks to all of you !
It worked well with: cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;

----------------->  Raimund  ----------------->



Sun, 09 Sep 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

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

2. Start-Up MDI app without opening empty document

3. Start MDI application with no empty document

4. DocView Application without empty document

5. Start an SDI App without a Document?

6. Start SDI app without new document?

7. start MDI without Document

8. Help! Start MDI app without document

9. How to start an application without invoking a document

10. How to Embed Microsoft Word Document without using document view architecture

11. Newbie: separate big .cs file into small .cs files

12. Starting MDI application with empty frame

 

 
Powered by phpBB® Forum Software