The AddString function of the CListBox instance is used to display the Parameters and Switches. Using a for loops, we iterate through each CStringArray and display the content in the CListBox instances. Once the dialog has the information, it displays those by adding it to the corresponding m_lst_params, m_lst_switches by iterating through the CStringArray instances.Īfter the call, our dialog has the command line information in the CStringArray instances. The function will fill the passed CStringArray with parameters and switches. GetAt(i)) įirst, we make a call to the GetCommandLinePasrser of Application instance. CStringArray params, switches ((CCmdLineDlgApp *) AfxGetApp())-> GetCommandLinePasrser( params, switches) for ( int i = 0 i
#Examples of command line arguments full
Because of this, we will get the opportunity to process every param passed from the command line.īelow is the Full Class definition: class CCommandParse : public CCommandLineInfo We override the ParseParamfunction of the base class CCommandLineInfo. The Get functions will receive reference parameters and copies the String Array values from the class’s member variable. Switches will tell how the application should behave based on the information passed for processing. One will hold command line data and another one will hold command line switches. We have two MFC string Arrays declared in this class.