By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,561 Members | 3,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,561 IT Pros & Developers. It's quick & easy.

Get process exit reason

P: n/a
Hi,

I my program runs other program(form) by process.start. In some cases
the other program gets exception and dies.

Can I get the reason of the termination of other program(Stopped by
user, exception). Note that when the other program dies due to
exception, it writes to messagebox.

does the "StandardOutput" and "StandardError" is only good for console
application?

thanks all.

Feb 27 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

you can query the Process.ExitCode property (provided that the application
sets an exit code), or catch the Win32Exception thrown when a problem was
encountered.

The StandardOutput and StandardError are streams - how they are used depends
on you.

Hope this helps,
Hans.

"al********@gmail.com" wrote:
Hi,

I my program runs other program(form) by process.start. In some cases
the other program gets exception and dies.

Can I get the reason of the termination of other program(Stopped by
user, exception). Note that when the other program dies due to
exception, it writes to messagebox.

does the "StandardOutput" and "StandardError" is only good for console
application?

thanks all.

Feb 27 '07 #2

P: n/a
On Feb 27, 1:46 pm, Hans <H...@discussions.microsoft.comwrote:
Hi,

you can query the Process.ExitCode property (provided that the application
sets an exit code), or catch the Win32Exception thrown when a problem was
encountered.

The StandardOutput and StandardError are streams - how they are used depends
on you.

Hope this helps,
Hans.

"alexia....@gmail.com" wrote:
Hi,
I my program runs other program(form) by process.start. In some cases
the other program gets exception and dies.
Can I get the reason of the termination of other program(Stopped by
user, exception). Note that when the other program dies due to
exception, it writes to messagebox.
does the "StandardOutput" and "StandardError" is only good for console
application?
thanks all.- Hide quoted text -

- Show quoted text -
Hello Hans,

On what dll does "Win32Exception" exists? does it returns the exit
reason of an app?

thanks.

Feb 27 '07 #3

P: n/a
Alexia,

in general, the namespace is denoted at the bottom of the "About ... class"
help page (where ... stands for the class your looking for).

Win32Exception is located in System.ComponentModel.dll.

Hope this helped you out,
Hans.

"al********@gmail.com" wrote:
On Feb 27, 1:46 pm, Hans <H...@discussions.microsoft.comwrote:
Hi,

you can query the Process.ExitCode property (provided that the application
sets an exit code), or catch the Win32Exception thrown when a problem was
encountered.

The StandardOutput and StandardError are streams - how they are used depends
on you.

Hope this helps,
Hans.

"alexia....@gmail.com" wrote:
Hi,
I my program runs other program(form) by process.start. In some cases
the other program gets exception and dies.
Can I get the reason of the termination of other program(Stopped by
user, exception). Note that when the other program dies due to
exception, it writes to messagebox.
does the "StandardOutput" and "StandardError" is only good for console
application?
thanks all.- Hide quoted text -
- Show quoted text -

Hello Hans,

On what dll does "Win32Exception" exists? does it returns the exit
reason of an app?

thanks.

Feb 28 '07 #4

P: n/a
On Feb 28, 10:50 am, Hans <H...@discussions.microsoft.comwrote:
Alexia,

in general, the namespace is denoted at the bottom of the "About ... class"
help page (where ... stands for the class your looking for).

Win32Exception is located in System.ComponentModel.dll.

Hope this helped you out,
Hans.

"alexia....@gmail.com" wrote:
On Feb 27, 1:46 pm, Hans <H...@discussions.microsoft.comwrote:
Hi,
you can query the Process.ExitCode property (provided that the application
sets an exit code), or catch the Win32Exception thrown when a problem was
encountered.
The StandardOutput and StandardError are streams - how they are used depends
on you.
Hope this helps,
Hans.
"alexia....@gmail.com" wrote:
Hi,
I my program runs other program(form) by process.start. In some cases
the other program gets exception and dies.
Can I get the reason of the termination of other program(Stopped by
user, exception). Note that when the other program dies due to
exception, it writes to messagebox.
does the "StandardOutput" and "StandardError" is only good for console
application?
thanks all.- Hide quoted text -
- Show quoted text -
Hello Hans,
On what dll does "Win32Exception" exists? does it returns the exit
reason of an app?
thanks.- Hide quoted text -

- Show quoted text -
Thanks, I'll look into it.

Mar 1 '07 #5

P: n/a

I am using System.Diagnostics.Process class to open a word document by call
ing Process.Start("test.doc"). I am using C# as programming language. On some
of the computers on running this code i get "Access is Denied"
Win32Exception. What do i do to not generate this exception ?
Mar 15 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.