Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have weird bug

If you create dynamically a toolbar on ArcGIS Desktop extension, and then try to hide it . It will crash Desktop 10.1 on Windows XP. But work find on Windows 7.

So, for example this simple code for Desktop extension.

on the Startup event write this simple code

public void Startup(ref object initializationData)
        m_application = initializationData as IApplication;

        if (m_application == null)

        var commandBars = m_application.Document.CommandBars;
        var myToolbar = commandBars.Create("My First toolbar", esriCmdBarType.esriCmdBarTypeToolbar);

        //Find my own personal command
        var uid = new UIDClass();
        uid.Value = "{057234a3-d67b-4b84-9781-4e2d028d51c9}"; // or any registered command in desktop
        // you can replace it with any built-in desktop command
        var command = commandBars.Find(uid, false, false);
        object outme = null;
        myToolbar.Add(uid, ref outme);

        var standardUid = new UIDClass(); //find the standard toolbar to dock it to it
        standardUid.Value = "esriArcMapUI.StandardToolBar";
        var stndToolbar =     commandBars.Find(standardUid, false, false) as ICommandBar;
        myToolbar.Dock(esriDockFlags.esriDockRight, stndToolbar);

You can put that code anywhere you want, and not necesserly an extension startup. Now. if you try to hide the toolbar, with right-mouse click on the toolbar area, and uncheck the toolbar. The desktop will crash on XP.

share|improve this question
What edition and service pack of XP are you using? And is it 32bit or 64bit? Your configuration may not meet ArcGIS for Desktop 10.1 System Requirements. – PolyGeo Mar 20 '13 at 21:57
I am meeting the system requirements It is XP Professional with SP3 (32 bit) – gkar Mar 21 '13 at 16:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.