calling shell program, how can i pass commands to stdin?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
El_isra
Experienced Solver
Experienced Solver
Posts: 50
Joined: Tue Apr 13, 2021 1:10 am
Location: Buenos Aires, Argentina
Contact:

calling shell program, how can i pass commands to stdin?

Post by El_isra »

I want to execute this program from my GUI and execute some commands

I haven't faound anythin usefull (excluding wxShell() )

Could anyone point to a good guide/explanation on how to achieve this?

The program doesnt have any argv[] parsing, everything is done trough manual input
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: calling shell program, how can i pass commands to stdin?

Post by doublemax »

Use wxProcess and wxExecute
https://docs.wxwidgets.org/trunk/classwx_process.html
https://docs.wxwidgets.org/trunk/group_ ... cctrl.html

Take a look at wxProcess::GetInputStream/GetOutputStream

Check the "exec" sample that comes with wxWidgets.
Use the source, Luke!
jpo234
Experienced Solver
Experienced Solver
Posts: 70
Joined: Tue Feb 25, 2020 11:34 am

Re: calling shell program, how can i pass commands to stdin?

Post by jpo234 »

El_isra wrote: Fri Jul 09, 2021 4:43 pm I want to execute this program from my GUI and execute some commands

I haven't faound anythin usefull (excluding wxShell() )

Could anyone point to a good guide/explanation on how to achieve this?

The program doesnt have any argv[] parsing, everything is done trough manual input
Have you considered boost::process?

https://www.boost.org/doc/libs/1_76_0/d ... troduction
Post Reply