1

I'm trying to a add a new menu drop down to the ArcCatalog menu bar. I tried to use the built in ArcGIS base menu template in Visual Studios 2010 but no luck. I also tried to manually add the dll create with the base menu template in the custom dialog box but my menu does or menu items do not appear in the list.

I think my best approach is to use the IExtension but all the example I see online is using ArcMap. The examples retrieve the main menu by getting it from a new or open document using the "IApplication...CommandBar.Find" but I don't think there's a "document" in ArcCatalog?

I tried the following with no luck. I assume the document return from the IApplication is a GxDocument. I might be wrong.

 public void Startup(ref object initializationData)
 {
 ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
 ICommandBar topMenu = null;
 UID topMenuUid = new UIDClass();
 object index = null;
 ICommandBars commandBars = null;
 IDocument document = null;
 if (initializationData is IGxApplication)
 {
 m_application = (IApplication)initializationData;
 topMenuUid.Value = ARCCATALOG_MAIN_MENU_UID;
 document = m_application.Document;
 ICommandBars commandBars = document.CommandBars;
 }
 }
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jan 9, 2014 at 2:06

1 Answer 1

1

There is a document in ArcCatalog as well, a single one which exists through the whole application run. See GxDocument. You can manipulate command bars the same way.

answered Jan 9, 2014 at 8:53
2
  • Hi. I added code to my comment with your suggestion. Could you see if I'm doing something wrong. The method Startup(..) is a member of the IExtension class. Thanks. Commented Jan 9, 2014 at 12:05
  • First, drop the RuntimeManager.Bind call, it's intended for standalone applications. Second, modifications to the UI should be done after the application is initialized - see IApplicationStatusEvents as well as the "Calling during startup" section in the ICommandBars.Find docs. Commented Jan 9, 2014 at 12:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.