Expand Minimize
1 out of 1 rated this helpful - Rate this topic

CWinApp::ParseCommandLine

Call this member function to parse the command line and send the parameters, one at a time, to CCommandLineInfo::ParseParam.

void ParseCommandLine( 
   CCommandLineInfo& rCmdInfo  
);
rCmdInfo

A reference to a CCommandLineInfo object.

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:

  1. After being created in InitInstance, the CCommandLineInfo object is passed to ParseCommandLine.

  2. ParseCommandLine then calls CCommandLineInfo::ParseParam repeatedly, once for each parameter.

  3. ParseParam fills the CCommandLineInfo object, which is then passed to ProcessShellCommand.

  4. 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.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.