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.
This solved my primary issue, but gave me a bunch of new issues, so might return later :P
Cool! I should update the FAQ. Thanks for bringing it up.
Also, curious as to what the new issues are. If related to the FAQ, I would like to fix them.
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()
//Kasper D.
Last edited by KasperD; May 6th, 2009 at 05:07 AM.
Bookmarks