wrap an exe into a GUI

mireazma

New member
Joined
Feb 22, 2015
Messages
1
Programming Experience
Beginner
Hello.
I have a command line exe that accepts arguments and I want to make it a GUI. I have a 0.5 years worth of programming skills but this is my first attempt to make a GUI application with MSVC 2013 (Windows Application Forms). I'm following some tutorials in parallel for the GUI part. I'd like to know how an approach to call the exe from within my app feeding the arguments from controls.
I'm thinking I let the user fill in the controls values and on pressing "run" I create a string with exe name and concatenate parsed values from controls than I execute the string.
1. Is there a better approach? How would you go about it?
2. How can I call an exe?
3. Other considerations?
 
You can call Process.Start from your WinForms app to execute your commandline app. You can redirect the stdin and stdout streams of that process and thereby send input in and get output out. This might help:

Automate Command Prompt Window (CMD), Redirect Output to Application

The code there is VB but the principle is the same. Once you know what to look for, you may well be able to find C# examples on the web.
 
Back
Top Bottom