Get process exit reason

  • Thread starter Thread starter alexia.bee
  • Start date Start date
A

alexia.bee

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.
 
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.
 
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.









- Show quoted text -

Hello Hans,

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

thanks.
 
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,

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.








- Show quoted text -

Thanks, I'll look into it.
 
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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top