Dim
Si As New ProcessStartInfoDim P As New ProcessP.StartInfo = SiSi.FileName = ("MyExePath")Si.UseShellExecute = FalseSi.RedirectStandardOutput = TrueP.Start()Console.WriteLine(P.StandardOutput.ReadToEnd())P.WaitForExit()so you have a GUI winform app but want to run it from the command line correct? and any outputs you want made from your GUI app you wish to see it on the Command line (MSDOS) window correct?
Well, the above solution from DMan1 will not work as the solution would work if you are executing a 3rd party app outside of your application - which is not what you would like from your description
The Console.Write() or System.Diagnostics.Debug.Write() will work within the IDE output Window.
I am unsure how you would write to the MSDOS window within a WinForm app (GUI) however you could give the Console a streamwriter to write to a textfile for example in this case if it helps?
if you go to your project properties in the "Application" tab, if you set the "output type" to Console Application, this will/should write your output to the console window as well as running your winform app
does this help?
I instantiated that streams and received valid streams although, the second was a null stream.
There is abother approach.
You begin with a console task and add forms capability as shown here:
It seems as though it can be a gui app, or a console app, but not both so far......
No, it's not "Output type" it's Application Type. Running such an application brings up a command window and a form in classic styling.
"Outputs" to say textbox1.text still go to textbox1.text.
I think the OP needs to define what inputs and outputs are being referred to and so do you.
just did this video for you:
http://www.spapps.co.uk/msdn/forums/vids/ConsoleGUI.wmv
http://www.ai2005.pwp.blueyonder.co.uk/ConsoleGUI.wmv - if the above link doesnt work
Apparently flipping the app type like that lets the gui app to run normally (as near as I can tell). The only down side is that, if run from an icon (non-console) the app pops open a shell window. Since this app will only be run from a command line, that shouldn't be a problem.
Hi,
Well... Guess what... does that also work in Visual Studio 2005? Being a novice to VS2005, I can not get it to work! Very frustrated... Many, many years of programming experience in C... and now, in VS2005 and C++, I can not get anything on the standard output, in combination with a GUI application...
Please help.
Matthijs.