hello
I have a custom extension created in VB.NET for ArcGIS. In one of the forms I have two tools which do very similar things (select a point from the map area) and so the code is rather similar. One of the tools works but the other throws a NullReferenceException. It happens because the following line returns nothing:
pCommandItem = Application.Document.CommandBars.Find(pUID, False, False)
However, and this is what is confusing to me - apart of course from why the two tools with similar wording has one not work ... If I add the tool to the ToolBar for the whole extension then it works in this form.
This is not a good solution since I do not want the tool in the ToolBar - it only works in relation to what the form is doing. But why should it be working if it is added to the ToolBar, but not if it, and the similar tool are added to the Form?
Any ideas?
cheers
shawn