The OnDisconnection event procedure occurs when the COM add-in is unloaded (disconnected). The add-in should perform resource clean-up operations in this event and restore any changes made to MapPoint, such as removing any added menu items.
An add-in can be unloaded in one of the following ways:
The user clears the check box next to the add-in in the COM Add-ins dialog box.
MapPoint closes. If the add-in is loaded at the time MapPoint closes, then it is unloaded. If the add-ins load behavior is set to Startup, it will be reloaded when MapPoint starts again.
|object||An expression that evaluates to a COM add-in.|
|RemoveMode||Long. An integer that corresponds to how the add-in was unloaded.
|Custom||Variant. An empty array; ignored in COM add-ins for MapPoint.|
To make your COM add-in available to users, you must add it to the MapPoint Tools menu using the AddCommand method.