ArcMap add-in initialization

912
4
10-19-2019 02:46 AM
MaxMax2
Occasional Contributor II

I'm developing add-in using ArcObjects for .NET for ArcMap. Where can I place code on add-in startup and shutdown? Right now I'm using extension within add-in for that purpose. But I want to get rid of extension. Is it possible?

Tags (2)
0 Kudos
4 Replies
DuncanHornby
MVP Notable Contributor

What sort of AddIn are you creating? A button, a toolbar with buttons, a panel...?

0 Kudos
MaxMax2
Occasional Contributor II

Toolbar with buttons. But it doesn't matter. I need to do some actions when add-in starts and finishes. And I want to do these actions without extension.

0 Kudos
DuncanHornby
MVP Notable Contributor

Have you seen this page, they are wiring up application events within an addin.

In the past I've set the onDemand property to False for a button which forces the addin button to load and you can run code in the onstartup() but this does not deal with shutdown.

0 Kudos
MaxMax2
Occasional Contributor II

I think using application events is wrong way. I need exactly points in time where add-in initialized and uninitialized. I can use extension for that purpose. But it's complexity without any benefits for user (user should remember that turning extension on in Extension dialog is required to use add-in).

0 Kudos