Zurix
Zurix

Reputation: 45

How to encapsulate a console exe file within a GUI app?

I have a exe file that runs from DOS console. Is there a way to create a GUI a simple window with some input text boxes and associate this visual interface with the exe file?

The file runs from DOS like this.

Program1.exe a b inputfile > output.txt

I'd like to have a new exe, for example Program2.exe, with the Program1.exe contained inside and when I do double click ove Program2.exe launches the GUI that would let me select the Input file will produce Output.txt after the Program2.exe calls Program1.exe.

Is this possible with C, C++, Visual basic, java?

Thanks for any suggestion.

Upvotes: 0

Views: 648

Answers (2)

bibekdahal
bibekdahal

Reputation: 74

If you have your console program "Program1.exe" in your drive, you can run it using the C function - system:

system("Program1 a b inputfile > output.txt");

If you really want to store the console program in the GUI program, then you may store it as some binary resource/data and extract it to the drive during execution. Here are some ways to embed binary data in a C program: http://gareus.org/wiki/embedding_resources_in_executables

Upvotes: 1

nishparadox
nishparadox

Reputation: 770

Learning GUI programming would do good. There are many libraries that offer GUI programming like QT, GTK compatible with c++.

Upvotes: 0

Related Questions