Hello guys,
I am working on Gui Appclication in WxDevc ++ 7.
I have a Button which has a following funktion ... System("ip-config")..
I want get the output in my WxTextCtrl instead in a windows cmdbox.
How can use the WxTextCtrl as a Cmdbox?
There is no Solution @ "google"
help me.
WxTextCtrl as Cmd Out/input
- marcelinux
- Knows some wx things
- Posts: 40
- Joined: Thu Nov 07, 2013 9:59 pm
- Location: Madrid, Spain
Re: WxTextCtrl as Cmd Out/input
http://docs.wxwidgets.org/3.0/classwx_process.html
I hope this help you.wxProcess also supports IO redirection of the child process. For this, you have to call its Redirect() method before passing it to wxExecute(). If the child process was launched successfully, GetInputStream(), GetOutputStream() and GetErrorStream() can then be used to retrieve the streams corresponding to the child process standard output, input and error output respectively.
I just need learn a little bit more. Thank you for your help.
Re: WxTextCtrl as Cmd Out/input
By the way, the bundled "exec" sample demonstrates how to capture and display output of another process.
-
- Earned some good credits
- Posts: 113
- Joined: Sat Sep 24, 2011 9:32 pm
- Location: Poland
Re: WxTextCtrl as Cmd Out/input
If output of your function is a text (wxString) you can show it inside of wxTextCtrl in this way:
If output of your function is a number (int, long, etc) you can show it inside of wxTextCtrl in this way:
regards, Jarek
Code: Select all
textctrlYourTextCtrl->AppendText(stringYourOutputText);
Code: Select all
textctrlYourTextCtrl->AppendText(wxString::Format(wxT("%d"), intYourOutputNumber));