CCommandLineInfo::m_nShellCommand

说明:
指明应用实例的外壳命令。
它的数据类型可以是在CCommandLineInfo中定义的以下枚举值:
enum
{
  Filenew,
  FileOpen,
  FilePrint,
  FilePrintTo,
  FileDDE,
  FileNothing =-1
};
下面是这些值的详细说明:
·CCommandLineInfo::FileNew命令行参数中没有发现文件名。
·CCommandLineInfo::FileOpen命令行参数中有文件名,但是没有下面的选项:/p,/pt,/dde。
·CCommandLineInfo::FilePrint命令行参数中有选项/p。
·CCommandLineInfo::FilePrintTo命令行参数中有选项/pt。
·CCommandLineInfo::FileDDE命令行参数中有选项/dde。
·CCommandLineInfo::FileNothing不在启动时显示一个新的MDI子窗口。AppWizard在生成的MDI应用在启动时是要显示一个新子窗口的。应用在调用ProcessShellCommand时用CCommandLineInfo::FileNothing作为外壳命令就可以关闭这个选项。所有从类CWinApp派生出的类的InitInstance函数都会调用ProcessShellCommand。

示例:
BOOL CMyWinApp::InitInstance( )
{
  // Parse command line for standard shell command,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::m_strFilename, CCommandLineInfo::m_strPrinterName, CCommandLineInfo::m_strDriverName, CCommandLineInfo::m_strPortName, CWinApp::ProcessShellCommand