I have inherited a C# ESRI (ArcMap) add-in that needs a UI tweak (the rest of the changes are completed). And I had no previous experience with such add-ins before starting on this.
The add-in in question has a DockableWindow, but I need to be able to click on the map and get the coordinates of the click (the inherited version required typing in the coordinates manually).
Research indicated that the only way to do this was to create a new class inheriting from a Tool, and use OnMouseDown()/OnMouseUp() to do the work. (I did try overriding OnMouseClick() in the DockableWindow, but that seems to only capture clicks within the DockableWindow. Not a huge surprise there.)
In any event, I created the Tool, added a line for it in the .esriaddinx file, and saw that it was added to ThisAddIn.IDs.
Everything I've read seems to indicate that the next steps are to get the UID for it, do a Find on the document's command bars using that UID, then set the app's currentTool to my tool.
The only problem is that, when I try this, the Find always returns null.
I've even tried creating my own command bar, adding the Tool to that command bar, displaying the command bar, and doing the Find on that command bar. Still, I always get null.
Is there another step that I'm missing? (And sorry about the lack of actual code; the development machine is not near a computer connected to the internet.)