In my addin, the DeleteView() removes the view from the TaskPane visually but my Activex is still running.
I only realized my issue because I have popup reminders which still popup after the view is removed by the DeleteView().
Must be something simple I am missing and I am hoping someone can help me out.
Public ctrl As SldWorks.TaskpaneView
Function ConnectToSW(ByVal ThisSW As Object, ByVal Cookie As Integer) As Boolean Implements SWPublished.SwAddin.ConnectToSW
iSwApp = ThisSW
addinID = Cookie
iSwApp.SetAddinCallbackInfo(0, Me, addinID)
iCmdMgr = iSwApp.GetCommandManager(Cookie)
AddCommandMgr()
LoadMyTaskPanel()
SwEventPtr = iSwApp
openDocs = New Hashtable
AttachEventHandlers()
ConnectToSW = True
End Function
Function DisconnectFromSW() As Boolean Implements SWPublished.SwAddin.DisconnectFromSW
RemoveCommandMgr()
UnLoadMyTaskPanel()
DetachEventHandlers()
iSwApp = Nothing
GC.Collect()
DisconnectFromSW = True
End Function
Sub LoadMyTaskPanel()
Dim bitmap As String
Dim toolTip As String
Dim ctrlName As String
Dim ctrlLicKey As String
bitmap = "c:\Images\Taskpane.bmp"
toolTip = "My SW Control"
ctrlName = "MY_SW_Control"
ctrlLicKey = ""
ctrl = iSwApp.CreateTaskpaneView2(bitmap, toolTip)
ctrl.AddControl(ctrlName, ctrlLicKey)
ctrl.ShowView()
End Sub
Sub UnLoadMyTaskPanel() ' Popups still activating even after ctrl is successfully removed from the TaskPane visually.
ctrl.DeleteView()
ctrl = Nothing
End Sub
SolidworksApi macros