Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

CCommandLineInfo Class 

Aids in parsing the command line at application startup.


class CCommandLineInfo : public CObject

An MFC application will typically create a local instance of this class in the InitInstance function of its application object. This object is then passed to CWinApp::ParseCommandLine, which repeatedly calls ParseParam to fill the CCommandLineInfo object. The CCommandLineInfo object is then passed to CWinApp::ProcessShellCommand to handle the command-line arguments and flags.

You can use this object to encapsulate the following command-line options and parameters:

Command-line argument Command executed

app

New file.

app filename

Open file.

app /p filename

Print file to default printer.

app /pt filename printer driver port

Print file to the specified printer.

app /dde

Start up and await DDE command.

app /Automation

Start up as an OLE automation server.

app /Embedding

Start up to edit an embedded OLE item.

app /Register

app /Regserver

Informs the application to perform any registration tasks.

app /Unregister

app /Unregserver

Informs the application to perform any un-registration tasks.

Derive a new class from CCommandLineInfo to handle other flags and parameter values. Override ParseParam to handle the new flags.

Header: afxwin.h

Community Additions

ADD
Show:
© 2015 Microsoft