Skip to Content
author's profile photo Former Member
Former Member

System.Diagnostics.Process.Start and UI 2004

Can anyone tell me if (how) I can use System.Diagnostics.Process.Start to spawn external applications from a trapped item event in my add-on?

My application model is the standard startup/sub main. It looks like this:

Module Startup

Sub Main()

Dim oAV As MyObject

oAV = New MyObject

' Startup

System.Windows.Forms.Application.Run()

End Sub

End Module

MyObject contains a "New()" that sets the SBO_Application object etc. It also contains a few subs that capture events in the sbo UI such as button presses. Now, the trick - how do I set up my threading model correctly to allow me to launch an external application like calculator from within the UI?

Thanks in advance!

Ty Babcox

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 14, 2005 at 10:36 PM

    Dim ProcID As Integer

    ' Run Calculator.

    ProcID = Shell("C:\Windows\system32\calc.exe", AppWinStyle.NormalFocus)

    Seems to work but I was hoping to use .Process.Start

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      It sounds like you are having a problem becuase you are launching your application (calc.exe in example) under a thread that is then closing. You can use the invoke delegate to launch from the 'parent' thread. You will probably have to make a delegate function and call that with me.invoke(delegate)

      Look at 'invoke' in the msdn.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.