I am migrating a 9.3 based Desktop extension, to 10.1 The Extension, is building toolbars on the fly. It creates the toolbar, and add the commands to it. This is the snippets of the code that does this

ICommandBar commandBar = Document.CommandBars.Create("name", ESRI.ArcGIS.SystemUI.esriCmdBarType.esriCmdBarTypeToolbar);


int indexAsObject = commandBar.Count;
commandBar.add((ToolContainer) item, ref indexAsObject);
.... (repeat the above two statements to add all commands)

ICommandItem toolbarAsCommandItem = (ICommandItem) commandBar;
toolbarAsCommandItem.Tag = tagvalue;

The above code is working on 9.3

But on 10.1, it is adding the commands correctly, but the commandBar is not refreshed, and it is empty The toolbars are shown empty, and without any name. The product I am using is ArcMap, and I am calling the above code from

IDocument.NewDocument event

Any idea?

  • How do you know it is adding the commands if it appears empty? Can you manually do something to make it refresh? – Kirk Kuykendall Jan 30 '13 at 22:42
  • If the commands are adding into the toolbar then they should be listed under the ESRI MX CommandBars group using the Cateogries.exe e.g. location C:\Program Files\ArcGIS\Desktop10.0\Bin\Categories.exe – artwork21 Jan 30 '13 at 23:58
  • The commands are not created on the fly. The commands are classes registered properly as COM Componenents. Just the toolbars are created on the fly. So, I can see the commands listed and registered. And I know the commands are added because while debugging , I can check the toolbar how many commands it has. – Ghassan Karwchan Jan 31 '13 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.