|
-
May 14th, 1999, 03:14 AM
#1
How to start an MDI empty?
I do not want, when I start my MDI program, a Child Window to be created and displayed. I have trace it but I cannot find what to modify or delete.
Any idea is appreciated
Thanks
-
May 14th, 1999, 03:54 AM
#2
Re: How to start an MDI empty?
Put the following 'if' block:
---
if (cmdInfo.m_nShellCommand != CCommandLineInfo::FileNew)
{
.
.
.
}
---
around the existing code lines:
---
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
---
in your app's InitInstance() method (that way, if the command line is blank (which is changed to FileNew), then the command will NOT get processed).
How's that?
-
May 14th, 1999, 05:29 AM
#3
Re: How to start an MDI empty?
Replace
// 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;
with this
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// no empty document window on startup before clicking the File New (XL)
if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew) {
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
}
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
in BOOL CyourApp::InitInstance().
It works for MDI.
-
May 14th, 1999, 05:59 AM
#4
Re: How to start an MDI empty?
I knew there was slightly different way, but CCmdLineInfo::FileNothing is not listed in the help with VC++ V4.0, so I couldn't remember it and didn't trust my memory; but I think the other way also works OK, since if /p or a filename are specified on the command line then CCmdLineInfo::m_nShellCommand will NOT be CCmdLineInfo::FileNew and so ProcessShellCommand() WILL get executed in that situation.
Thanks for the reminder, though.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|