CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);

解决方案 »

  1.   

    CCommandLineInfo class aids in parsing the command line at application startup
    第一句是创建一个CCommandLineInfo类的对象
    第二句是解析命令行并且一次一个的传递参数给  CCommandLineInfo::ParseParam.
    这是在MFC程序刚开始的时候所要对命令行的处理
      

  2.   

    MSDN 
    Call this member function to parse the command line and send the parameters, one at a time, to CCommandLineInfo::ParseParam.void ParseCommandLine(
       CCommandLineInfo& rCmdInfo 
    );
    Parameters
    rCmdInfo 
    A reference to a CCommandLineInfo object. 
    Res
    When you start a new MFC project using the Application Wizard, the Application Wizard will create a local instance of CCommandLineInfo, and then call ProcessShellCommand and ParseCommandLine in the InitInstance member function. A command line follows the route described below: After being created in InitInstance, the CCommandLineInfo object is passed to ParseCommandLine. 
    ParseCommandLine then calls CCommandLineInfo::ParseParam repeatedly, once for each parameter. 
    ParseParam fills the CCommandLineInfo object, which is then passed to ProcessShellCommand. 
    ProcessShellCommand handles the command-line arguments and flags. 
    Note that you can call ParseCommandLine directly as needed. For a description of the command-line flags, see CCommandLineInfo::m_nShellCommand.
      

  3.   

    我记得可以用它来实现某些运行参数的传递。在文档程序里,如果你不想在程序启动时创建新文档,你可以通过设置它来完成。同样的,它也可以在你申明后设置些其他的参数,如DDE或OLE。有兴趣可以看看MSDN,上面写的很全。