PC Review


Reply
Thread Tools Rate Thread

Launch External Program

 
 
Glenn Palomar
Guest
Posts: n/a
 
      9th Aug 2006
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


 
Reply With Quote
 
 
 
 
The Grim Reaper
Guest
Posts: n/a
 
      9th Aug 2006
Well.. usually, if the process hasn't exited, then it's running! I guess in
your case, that's not the case

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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Glenn Palomar
Guest
Posts: n/a
 
      9th Aug 2006
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.

"The Grim Reaper" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Well.. usually, if the process hasn't exited, then it's running! I guess
> in your case, that's not the case
>
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>
>>

>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      9th Aug 2006
"Glenn Palomar" <(E-Mail Removed)> 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/>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a button to launch an external program? M.Boone Microsoft Word Document Management 0 15th Oct 2009 04:20 PM
Launch external program - Compile error: Expected: list separator PJ Microsoft Excel Programming 2 19th Dec 2008 06:31 PM
how to create a rule to launch an external program with that messagedata in command line alltimefav Microsoft Outlook Discussion 0 3rd Mar 2008 05:32 PM
Add / remove program program will not launch Steven Windows XP Performance 1 10th Apr 2004 02:42 AM
Re: Open File (Launch in Browser vs Launch in Native Program) bob Windows XP Internet Explorer 0 1st Oct 2003 09:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:31 PM.