If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

Issues with Command Line Parsing in MFC

My very first post here at CodeGuru, so bear with me, if it doesn't comply with all the standards

I'm trying to add a command line interface to an existing MFC application. As of now I can open the application and load a file into the app. using the command line.

I would like the keep that functionality, and add three optional arguments to the command line interface. I've followed the example given by Kirants here: http://www.codeguru.com/forum/showthread.php?t=386406. The "ParseParam" function implemented in the exampel overrides the original ParseParam function, and therefore I'm unable to use the original ParseParam to open the file.

Re: Issues with Command Line Parsing in MFC

Re: Issues with Command Line Parsing in MFC

Hi kirants!

Okay, at least one of my new issues might be related to the FAQ

The order of arguments in the commandline matters. I would like it to be irrelevant.
e.g. "myAppName -opt1 file.txt" will execute option1, and open file.txt. But "myAppName file.txt -opt1" will execute option1, but will not open the file.

My final problem is a minor one - I would like the program to be able to handle 3 options. e.g. "myAppName -opt1 -opt2 -opt3 file.txt" which is suppose to open the file, and execute the three options. I 've solved this issue by not using an else-if-ladder in the initInstance()

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.