简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM