Home All Groups Group Topic Archive Search About

Launch External Program

Author
9 Aug 2006 5:09 PM
Glenn Palomar
Hi,

How will you know if an external program has launched successfully? I'm
trying to use System.Diagnostics.Process class.

I know that you can check if the process has exited but can you tell if it
has launched it successfully?

Thanks,
Glenn

Author
9 Aug 2006 5:21 PM
The Grim Reaper
Well.. usually, if the process hasn't exited, then it's running!  I guess in
your case, that's not the case :D

There's Process.Responding, which will tell you is the process is "active"
in the eyes of the OS.
I think that's all that could be useful.
Which process are you needing to know about??
__________________________________________________
The Grim Reaper


Show quoteHide quote
"Glenn Palomar" <glenn.palo***@autodesk.com> wrote in message
news:OUw1Wa9uGHA.4888@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> How will you know if an external program has launched successfully? I'm
> trying to use System.Diagnostics.Process class.
>
> I know that you can check if the process has exited but can you tell if it
> has launched it successfully?
>
> Thanks,
> Glenn
>
>
Author
9 Aug 2006 5:49 PM
Glenn Palomar
I wanted my application to block until it has loaded the external
application (Inventor).

I guess I can put it in a while loop and wait until I get something when I
call Marshal.GetActiveObject.

Show quoteHide quote
"The Grim Reaper" <grim_rea***@REMOVEbtopenworld.com> wrote in message
news:hI2dnfIqUb8fhEfZRVnyhw@bt.com...
> Well.. usually, if the process hasn't exited, then it's running!  I guess
> in your case, that's not the case :D
>
> There's Process.Responding, which will tell you is the process is "active"
> in the eyes of the OS.
> I think that's all that could be useful.
> Which process are you needing to know about??
> __________________________________________________
> The Grim Reaper
>
>
> "Glenn Palomar" <glenn.palo***@autodesk.com> wrote in message
> news:OUw1Wa9uGHA.4888@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> How will you know if an external program has launched successfully? I'm
>> trying to use System.Diagnostics.Process class.
>>
>> I know that you can check if the process has exited but can you tell if
>> it has launched it successfully?
>>
>> Thanks,
>> Glenn
>>
>>
>
>
Author
9 Aug 2006 9:17 PM
Herfried K. Wagner [MVP]
"Glenn Palomar" <glenn.palo***@autodesk.com> schrieb:
> How will you know if an external program has launched successfully? I'm
> trying to use System.Diagnostics.Process class.
>
> I know that you can check if the process has exited but can you tell if it
> has launched it successfully?

I assume an exception is thrown if the file cannot be found, for example.
In addition you may waht to check the exit code returned by the started
application:

\\\
Dim p As Process = Process.Start(...)
p.WaitForExit()
MsgBox(p.ExitCode)
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>