hi all,
in my application, i want to use command-line parameters, if no parameters specified, show open dialog to select a file
if -h or --help was specified, print the help message in console
but it works when i give no parameters to command-line!
the problem is, when i go to cmd, and type my application name followed by the parameters, it doesnt show anything and when i debug it, it exit's normally!
this is some parts of my code:
i've declared other variables here, and it is the continue
1 2 3 4 5 6 7 8
|
while( ++cmd < argc)
{
if (lexicographical_compare(argv[cmd], "-h") || lexicographical_compare(argv[cmd], "--help") || lexicographical_compare(argv[cmd], "-?"))
{
printhlp(argv[0]);
exit(0);
}
}
|
please note that i'm using boost libraries!
what is the problem? because the loop is here and my application processe's command line from here
thanks all in advance