473,507 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get process exit reason

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
5 3218
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
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
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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7760
by: Tung Wai Yip | last post by:
I've build the following utility. It works so far but I want to make sure I'm doing the right thing. I am running Python 2.3 on windows 2000. def execute(cmd): """ execute cmd in sub-process,...
1
2584
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
0
2860
by: SR | last post by:
Hi Would suggest that instead of using the process class and invoking the devenv, u try using the VS.Net object library. This will help you perform the operations in a much more controlled way....
3
2951
by: felixfix | last post by:
Hi all, I am just wondering if something is wrong with my program. What it bascially does is to output a fibonacci sequence base on the command-line output. If I give a 5, it will generate the...
12
2347
by: Raymond Lewallen | last post by:
How to wait for a process to stop completion is my goal. Obviously, the looping while waiting for the HasExited property is not a solution.. but thats the best I can come up off the top of my...
8
4686
by: Rain | last post by:
Does anyone know how i can kill a process using C#? im developing an asp.net web application using C# and the asp.net process doesnt die even if the application has already exited. So i need to...
9
18846
by: Eran.Yasso | last post by:
Hi, My app starts process. Some times this process exits because of exception. Can my app know if the process exited due to exception or gracefully? In both ways, the exit code of this...
4
20758
by: Richard Rossel | last post by:
Hi Fellows, I have a problem with process termination. I have a python code that apache runs through a django interface. The code is very simple, first, it creates a process with the...
4
2247
by: tdahsu | last post by:
All, I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.