[GIS] Application Extension vs. Add-in Application Extension

arcmaparcobjects

Background:
I am tasked with rewriting a 9.3 ArcMap solution based upon a VB6 implementation using an application extension and several forms. The interface to ArcMap is that this solution needs to find a running instance of ArcMap with a specific map in it and then selects features in a layer in that map. This will be redone for ArcMap 10.2 using C# and VS2012. I am new to ArGIS stuff and in someways new to .NET/COM development. Yes, I know I am in deep. 🙂

My Question:
I have read the documentation till my head is spinning – such a mixture of versions and FWs between both ESRI and MS. I cannot decide upon the proper approach. I feel that I should use a COM based application extension as the heart of the re-write, but I have also seen mentioned an Add-in application extension. What I don't know is, can I use an Add-in application extension instead of a full blown COM based one? Do they have the same abilities, or as in Add-in application extension more limited than a COM one? I have seen information that points to add-ins not being as capable as COM based solutions but this seems to be lessening with each release. To be honest, I don't even know if an Add-in application extension is the same kind of thing as a "traditional" application extension – and I can't find that out from the docks, which frankly, suck.

Additionally, if I AM able to go with an Add-in application extension, how capable are the dockable forms that apparently are part of Add-in land? In the VB6 Forms that I am replacing, database work using ADO to Oracle is being done. Would I still be able to do that with these dockable windows?

Best Answer

Both add-in extensions and traditional COM extensions run in-process, so there is no need to "find a running instance of ArcMap", as they will be hooked in by nature. Add-Ins do have some limitations that COM components don't, which this ArcGIS forum post sums up pretty well.

If you want to create a standalone program that remotely controls ArcMap, rather than a class library that runs inside ArcMap, you would use IAppROT to get a handle on a running ArcGIS application object and use IObjectFactory when you need to create in-process objects. This (old, but still applicable) help topic has some instruction on this, although it does not discuss IAppROT: How to automate ArcGIS Desktop applications

From your description of just needing to be able to select features in the map, I would suggest trying to use an ArcMap add-in, as they are a lot easier to get up and running with, and deployment is also much simpler. There are some quirks I have discovered, but there is a lot of info on this very site to start from.

Lastly see this answer for some more general .NET/COM programming suggestions as well as a little more background on the differences between add-ins and COM components.

Related Question