on 02-14-2005 10:10 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.