|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Launch External ProgramHi,
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 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 > > 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 >> >> > > "Glenn Palomar" <glenn.palo***@autodesk.com> schrieb: I assume an exception is thrown if the file cannot be found, for example. > 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? 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/>
Referencing Controls created at run time.
MS VB Newbie Tutorial Check to see if a server is running Check if a Windows service running Class item not accessible because it's private... but it's not? Dataset End all running code of .dll Description of Function How do I send null values to an integer type variable? Writing to a file opened in another class |
|||||||||||||||||||||||