Share via


CCommandLineInfo::m_nShellCommand

Remarks

Indicates the shell command for this instance of the application.

The type for this data member is the following enumerated type, which is defined within the CCommandLineInfo class.

enum{
   FileNew,
   FileOpen,
   FilePrint,
   FilePrintTo,
   FileDDE,
   FileNothing = -1
};

For a brief description of these values, see the following list.

  • CCommandLineInfo::FileNew   Indicates that no filename was found on the command line.

  • CCommandLineInfo::FileOpen   Indicates that a filename was found on the command line and that none of the following flags were found on the command line: /p, /pt, /dde.

  • CCommandLineInfo::FilePrint   Indicates that the /p flag was found on the command line.

  • CCommandLineInfo::FilePrintTo   Indicates that the /pt flag was found on the command line.

  • CCommandLineInfo::FileDDE   Indicates that the /dde flag was found on the command line.

  • 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;
...
};

CCommandLineInfo OverviewClass MembersHierarchy Chart

See Also   CCommandLineInfo::m_strFileName, CCommandLineInfo::m_strPrinterName, CCommandLineInfo::m_strDriverName, CCommandLineInfo::m_strPortName, CWinApp::ProcessShellCommand