Disconnect method
Disconnects, or unloads, a COM add-in.
Applies to
Collections: AddIns
Syntax
object.Disconnect(ProgId)
Parameters
Part | Description |
---|---|
object | Required. An expression that returns an AddIns collection. |
ProgId | Required String. The programmatic identifier for the COM add-in to disconnect. |
Remarks
To learn more about creating COM add-ins, see the About creating a COM add-in reference topic.
Example
Sub CallFunctionOnAddIn()
'Note this example requires that "MyAddInDLL.Connect" be
'the ProgID for a MapPoint add-in, and that "DoSomething"
'is a method on that add in. This allows "DoSomething"
'to be run in-process in MapPoint, and thus, be faster
'than code from a Visual Basic executable.
Dim objApp As New MapPoint.Application
Dim objAddIns As MapPoint.AddIns
Dim objMyAddIn As Object
'Set up application and objects to use
objApp.Visible = True
objApp.UserControl = True
Set objAddIns = objApp.AddIns
'Call method in AddIn DLL
Set objMyAddIn = objAddIns.Connect("MyAddInDLL.Connect")
objMyAddIn.DoSomething
objAddIns.Disconnect objMyAddIn
End Sub