Connect method

Connects, or loads, a COM add-in for use with the MapPoint application.

Applies to

Collections:  AddIns

Syntax

object.Connect(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 connect.

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