Reputation:
Recently, i've got interested in making a front-end for command-line program. I guess there's two way to do it.
First one is just including source code and calling main proc with arguments (Of course, there should be some changes in source code). Second one, which is there's no source code and just program, is just executing program internally then reading the command line with APIs.
Though I well know about the first solution, i don't know what APIs is needed to do the second solution. I'm talking about the APIs that get a command-line string or something like that.
Upvotes: 1
Views: 4447
Reputation: 11369
See this question for information on how to run an external application; basically, you need to call CreateProcess function. I'm not sure what you mean by "reading the command line", I suppose you mean reading the output of an executed program? As for capturing an external application's output, there's already another question asking for that, you will probably find this answer most helpful.
Upvotes: 1
Reputation: 2937
here is a codeProject project that I have used and can handle command line arguments for you (in the setup you describe). If you are not happy with it, you can use the direct WinApi calls using CommandLineToArgvW. Enjoy!
Upvotes: 0