Hello,
I want my application to attach to the EXISTING running SW session. With the following code bellow this is what happens:
If SW is NOT running, my code OPENS a new SW session If SW is running, my code (sometimes) STILL OPENS a new SW session
....................Questions........................
1.- How can I force the Task Manager to unload SW from the memory? 2.- How can I modify my code so the behaviour is the following...?If SW is NOT running -> do wgatever (print a string, show an error msg,... but DO NOT open a new SW session
If SW is tunning -> attach to current SW session
ps: I'm using Visual.NET and SW2003 Student Edition
Thank you,
JK
'------------- My Code -------------------
Private Sub MyForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
swApp As SldWorks.SldWorks
'START connection to SW session************************* swApp = Nothing 'swApp = GetObject(, "Sldworks.Application") '?????????????????? swApp = CreateObject("SldWorks.Application")
If swApp Is Nothing Then Call MsgBox("connection failed, (try opening SW)", vbOKOnly, "Error") End Else 'swApp Is Not Nothing swApp.Visible = True swApp.UserControl = True On Error Resume Next ' Disables VB's implicit error on QI End If Me.Text = "Type Helper (swDocType)" 'END connection to SW session*************************
End Sub