CWinApp::ParseCommandLine

void P&arseCommandLine (CCommandLineInfoamp ; rCmdInfo );

Paramètres

rCmdInfo

Une référence à un CCommandLineInfo objet.

Remarques

Appelez cette fo&nction membre pour analyser la ligne de commande et envoyer les paramètres, un à la fois, tonbsp ; CCommandLineInfo::ParseParam.

Lorsque vous démarrez un nouveau projet MFC AppWizard, AppWizard créera une instance locale de CCommandLineInfoet appelez ensuite ProcessShellCommand et ParseCommandLine dans la fonction membre InitInstance . Une ligne de commande suit l'itinéraire décrit ci-dessous:

  1. Après avoir créé dans InitInstance, l'objet CCommandLineInfo est passé à ParseCommandLine.

  2. ParseCommandLine appelle ensuite CCommandLineInfo::ParseParam à plusieurs reprises, une fois pour chaque paramètre.

  3. ParseParam remplit l'objet CCommandLineInfo , qui est ensuite transmis à ProcessShellCommand.

  4. ProcessShellCommand gère les arguments de ligne de commande et les drapeaux.

Notez que vous pouvez appeler ParseCommandLine directement au besoin.

Pour une description des indicateurs de ligne de commande, voir CCommandLineInfo::m_nShellCommand.

Aperçu de CWinApp |nbsp ; Membres de la classe | Graphique de la hiérarchie

Voir aussi  ;CCommandLineInfo, CWinApp::InitInstance, CCommandLineInfo::ParseParam, CWinApp::ProcessShellCommand, CCommandLineInfo::m_nShellCommand

Index