Hello to all,

I have a console executable file that I run from DOS console passing some options
and an input file. I'd like to give to this exe file a GUI.

I'd like that the GUI was a new exe file that could contain inside my console exe file
and run the console exe from the GUI, having the console exe file inside of the GUI file.

Is possible to do this with C++?

Please suggestions.

Thanks in advance.

Regards

Recommended Answers

All 8 Replies

It is possible to do but depending on how big your project is you might not want to do it that way. Calling another exe file requires a system call which incurs a lot of overhead. If it is possible I would just wrap you previous program in a wrapper and then included/call it in your new GUI application.

Hello Nathan,

Thanks for your answer. I understand from your answer that would be better to make a windows with input boxes, buttons etc and one of those buttons associate it with a command to call the "program.exe" each time is needed? it is correct?

I'm not expert in programming, do you know if could be "easier" make a simple GUI to call the "program.exe" in C++ or java or in another language?

Thanks for help me begin with this project.

Thanks again for your help.

If you have access to the source code for program.exe and it isn't very large I would just incorporate that program into the new GUI application. That way you avoid using system calls which should be avoided. If not then you would need to use system calls.

Hello Nathan,

Thanks for your answer.

The issue is the source code is in Ruby and in Ruby I cannot do it a GUI directly without use another 3rd party tool that I don't know which could be better without the need to re-do de Ruby code.

The code in Ruby is short and uses regex that C cannot handle and replicate what the Ruby code does using regex in another language without Regex complicates a lot the algorithm. I've been trying to replicate the code in java but still pending a lot of things, due to that I thougth in create a simple GUI to handle/call the exe file.

Regards

C++ is happy with regex and visual studio at least has it covered in std library.

However, GUI's are not really so simple, and I would advise to use C# instead, which also has regex capabilities, but is very very easy to create a GUI.

Hello Suzie,

Many thanks for your suggestion. I think C and C++ for what I investigated, don't handle lookbehind, lookahead or PCRE compatible regex. I'll check about C# since you mention that is very very easy to create a GUI :).

Regards

I never knew that about c and c++, but I'm pretty certain C# regex supports them.

Yes C# windows forms applications are really simple, mostly just drag and drop your controls then code the event handlers of those controls.

Event handlers which are auto generated I might add.

Hello Suzie,

Thanks for point me with C#, I've been learning and trying and yes, the PCRE regex worked fine.

I'm researching to trying to get my goal.

Thanks again.

Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.