Custom ArcGIS 9.3 Toolbar/Tools Conversion to ArcGIS 10 problems

2277
4
10-10-2011 01:15 PM
by Anonymous User
Not applicable
Original User: Genaro Garcia

I'm in the process of converting all my ArcGIS 9.3 desktop toolbars/tools to ArcGIS 10.
I have  gone thru the "How to ensure that COM component category and COM interop are used in custom components" online documents. Which I implemented into code below.  I also create an "SetUP" project, build solution, and installed the app using the MSI file.

I started ArcMap 10, but the toolbars with the tools don't show up available toolbars.

See attached file for code review.

Any ideas?

Genaro Garcia
The City of Oklahoma City
Genaro.Garcia@okc.gov
(405) 297-3172
0 Kudos
4 Replies
JamesCrandall
MVP Frequent Contributor
I'm in the process of converting all my ArcGIS 9.3 desktop toolbars/tools to ArcGIS 10.
I have  gone thru the "How to ensure that COM component category and COM interop are used in custom components" online documents. Which I implemented into code below.  I also create an "SetUP" project, build solution, and installed the app using the MSI file.

I started ArcMap 10, but the toolbars with the tools don't show up available toolbars.

See attached file for code review.

Any ideas?

Genaro Garcia
The City of Oklahoma City
Genaro.Garcia@okc.gov
(405) 297-3172


Try manually registering by clicking Customize-->CustomizeMode-->AddFromFile then navigate to the directory where your Setup installed the component and locate the .tlb file. 

Do your tools/toolbar load?

If so, then it could be something simple you are missing in your registration code process.
0 Kudos
by Anonymous User
Not applicable
Original User: Genaro Garcia

James,

I was thinking about doing that, but wasn't sure about uninstalling any of the toolbar/tools that load.

I did use the .tlb to load them.  The toolbar didn't load, but all the tools did.  See attached file.

At this point, I know that it's something within the toolbar�??s registration code.

Thanks for the advice,

Genaro
0 Kudos
JamesCrandall
MVP Frequent Contributor
Genaro,

Hopefully someone can spot the obvious issue and provide a quick solution.  Something else that I didn't mention previously is to consider placing your Toolbar items/controls onto a UserControl instead then hook the IApplication to this.  It also makes the IToolBarDef class much cleaner.

Basically, the ICommand class pretty much stays the same, except the OnCreate method creates a new instance of the UserControl, as well as passing the IApplication to it as mentioned above.  I remember moving to this approach because I was having issues with my Toolbar drawing funny and Neil made the suggestion to add a Panel to the UC and then add the controls to the Panel -- which this Panel could then be refreshed, removing my drawing funny issues.

I've stuck with this approach ever since.  Although I am not totally certain how much different other techniques (ESRI samples) differ.
0 Kudos
by Anonymous User
Not applicable
Original User: Genaro Garcia

I'm finally back to this project.
I rewrote the whole toolbar & tools using ArcGIS 10 Extending ArcObjects templates.
I added all the self-registration code on the tool and toolbar.

I added the bmp file for the tools and code.

So, what I have now is a custom toolbar and 3 custom tools that self-register within one project using MS Visual Studio 2010.  And Yes, I'm using MS .Net Framework 3.5.

When I build it, it only displays the toolbar without any tools.  I seem that it only created to toolbar and registered it.

Is there something that I'm missing?
Do I have to tell it to build and register the tools also?

Any help is greatly appreciated.
0 Kudos