For completeness, the simplest option;
1: 2: 3: 4: 5: 6: 7: 8: 9:
void main(int argc, char *argv[] ) { CString sFileParm; if ( argc > 2 ) { if ( CString(argv[1]) == "-x" ) { sFileParm= argv[2]; } } }