[VC++ MFC] Аргументы коммандной строки
GetCommandLine(это WinAPI, без всякого MFC)
The GetCommandLine function retrieves the command-line string for the current process.
LPTSTR GetCommandLine(void);
Parameters
This function has no parameters.
Return Values
The return value is a pointer to the command-line string for the current process.
CWinApp::ParseCommandLineSee Also(а это - MFC)
CWinApp Overview | Class Members | Hierarchy Chart | CCommandLineInfo | CWinApp::InitInstance | CCommandLineInfo::ParseParam | CWinApp::ProcessShellCommand | CCommandLineInfo::m_nShellCommand
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.
Remarks
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.
See Also
CWinApp Overview | Class Members | Hierarchy Chart | CCommandLineInfo | CWinApp::InitInstance | CCommandLineInfo::ParseParam | CWinApp::ProcessShellCommand | CCommandLineInfo::m_nShellCommand
спасибки!
Оставить комментарий
t332
Субж. Такое есть в проектах на MFC? Если да, то как к ним обращаться?