Launch External Program

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Glenn Palomar

    #1

    Launch External Program

    Hi,

    How will you know if an external program has launched successfully? I'm
    trying to use System.Diagnost ics.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


  • The Grim Reaper

    #2
    Re: Launch External Program

    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.Respond ing, 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.palomar@ autodesk.comwro te in message
    news:OUw1Wa9uGH A.4888@TK2MSFTN GP05.phx.gbl...
    Hi,
    >
    How will you know if an external program has launched successfully? I'm
    trying to use System.Diagnost ics.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
    >
    >

    Comment

    • Glenn Palomar

      #3
      Re: Launch External Program

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

      "The Grim Reaper" <grim_reaper@RE MOVEbtopenworld .comwrote in message
      news:hI2dnfIqUb 8fhEfZRVnyhw@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.Respond ing, 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.palomar@ autodesk.comwro te in message
      news:OUw1Wa9uGH A.4888@TK2MSFTN GP05.phx.gbl...
      >Hi,
      >>
      >How will you know if an external program has launched successfully? I'm
      >trying to use System.Diagnost ics.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
      >>
      >>
      >
      >

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Launch External Program

        "Glenn Palomar" <glenn.palomar@ autodesk.comsch rieb:
        How will you know if an external program has launched successfully? I'm
        trying to use System.Diagnost ics.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.ExitCo de)
        ///

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

        Comment

        Working...