CWinApp::ProcessShellCommand

此成员函数由 InitInstance 调用接受来自 CCommandLineInfo 对象传递的参数标识 rCmdInfo,并执行所指示的事件。

BOOL ProcessShellCommand(
   CCommandLineInfo& rCmdInfo 
);

参数

返回值

非零,则shell命令成功处理。 如果为 0,则返回从 InitInstanceFALSE

备注

使用应用程序向导,在开始新MFC项目,应用程序向导将创建 CCommandLineInfo本地实例,然后调用 ProcessShellCommandParseCommandLineInitInstance 成员函数。 命令行执行下面介绍的小路:

  1. 在创建在 InitInstance后,CCommandLineInfo 对象传递给 ParseCommandLine

  2. ParseCommandLine 重复随后需要 CCommandLineInfo::ParseParam,一次个参数。

  3. ParseParam 加载 CCommandLineInfo 对象,然后传递给 ProcessShellCommand

  4. ProcessShellCommand 处理命令行参数和标志。

CCommandLineInfo 对象的数据成员,这是由 CCommandLineInfo::m_nShellCommand,即以下枚举类型,在 CCommandLineInfo 选件类中定义的。

enum {

FileNew,

FileOpen,

FilePrint,

FilePrintTo,

FileDDE,

};

有关其中每一的简要说明个,请参见 CCommandLineInfo::m_nShellCommand

要求

Header: afxwin.h

请参见

参考

CWinApp选件类

层次结构图

CWinApp::ParseCommandLine

CCommandLineInfo选件类

CCommandLineInfo::ParseParam

CCommandLineInfo::m_nShellCommand