Click to See Complete Forum and Search --> : Where does the Output Window text come from
CrystalAnnoysMe
December 1st, 2004, 01:36 PM
So my VB.Net program executes a command line program as a process. I cannot redirect standard in or out because of the behavior of the third party program. I do need however to capture errors it reports. These errors seem to be displayed within the "Output Window" in the VB.Net IDE.
I've tried redirecting standard error but its always empty, unless I'm doin it wrong. Where is the Output window text coming from and how can I get to it? What I mean is the command line program I run when it has a error it put it into the Output window. How do I get to that info? I CAN redirect strerror if needed, but not in or out. Any ideas?
Allan.
Arjay
December 1st, 2004, 03:18 PM
The 3rd party app may be posting the errors as debug output (which the .net ide output window captures). To verify this, download the [free] DebugView program from www.sysinternals.com (http://www.sysinternals.com/) and start up the 3rd party app directly from the command line (or from the .net ide with your program running under "Release" mode - careful here as I don't know if VB has such a thing).
If the 3rd party app is indeed spewing error output to the debugger, it hopefully is also returning a meaningful application exit code that you can trap in VB. I am not a vb programmer but in Win32 you can use GetExitCodeProcess to retrieve it. There might be something similar for vb (or just use the Win32 function).
Arjay
CrystalAnnoysMe
December 1st, 2004, 09:04 PM
I used that app and it didnt catch anything. The wierd part is regular output from the program within the VB.Net IDE does not go to the output window, only when there is a error it puts the error in the output window.
Heres the wierd part though. It outputs ALL output from the program to the output window but only if I redirect standarderror. standardoutput is not redirected. If I turn off redirect on standarderror then nothing comes up in the output window.
This is related to another post I have called "Need to get stdoutput without redirect" or something like that. I'm running out of ideas though.
Allan.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.