OnConnection event

The OnConnection event occurs when the COM add-in is loaded (connected). An add-in can be loaded in one of the following ways:

The user starts MapPoint and the add-ins load behavior is specified to load when MapPoint starts.

The user loads the add-in in the COM Add-ins dialog box.

Syntax

object.OnConnection(Application, ConnectMode, AddInInst, Custom)

Part Description
object An expression that evaluates to a COM add-in.
Application Application object. An expression that evaluates to the MapPoint Application object.
ConnectMode Long. An integer that corresponds to how the add-in was loaded.
ext_ConnectMode Value Description
ext_cm_AfterStartup
0
Add-in was loaded after MapPoint started
ext_cm_CommandLine
3
Not supported
ext_cm_External
2
Not supported
ext_cm_Startup
1
Add-in was loaded on startup of MapPoint
AddInInst COMAddIn object. An expression that evaluates to the instance of the class module in which code is currently running. This is set to "Nothing" in MapPoint because MapPoint does not support a COMAddIn object.
Custom Variant. An empty array; ignored in COM add-ins for MapPoint.

Remarks

In order to make your COM add-in available to users, you must add it to the MapPoint Tools menu using the AddCommand method.

Although MapPoint does not support a COMAddIn object, you can use the AddIns collection to access the add-ins currently connected to MapPoint.