[C# .NET] Dockable Window Freeze everytime

2547
1
02-14-2012 06:18 AM
RobertoOliveira
New Contributor III
Edit:
forget, worked on another computer!
I still don't know the reason for the addin freeze the entire ArcMap, but I known that the problem is not the program code.



I'm having a little problem with dockable window and the "WebBrowser" .net control!
If I put a webbrowser with some url on a dockable window, the ArcMap freeze everytime that I try to move the dock window.

This is a simple test project that freeze everytime on my and another machine.

- Start Visual Studio (i'm using v2010).
- On template, Select ArcGIS\Desktop Add-Ins and then ArcMap Add-In.
- In the Wizard, on Add-In Type, I select 'Button' and 'Dockable Window'.
- Open the Dockable Window on Visual Studio Designer, and put a WebBrowser component.
- On URL property of WebBrowser component, put some valid URL (like www.esri.com).

- On button class, on the Click event, I put the following code:
        protected override void OnClick()
        {
            ESRI.ArcGIS.esriSystem.UID uid = new ESRI.ArcGIS.esriSystem.UIDClass();
            
            // this is from Config.esriaddinx (<DockableWindow id="Test_TestingAddin1_DockableWindow1" class="testbrowser+AddinImpl"...)
            uid.Value = "Test_TestingAddin1_DockableWindow1"; 

            ESRI.ArcGIS.Framework.IDockableWindow dw = ArcMap.DockableWindowManager.GetDockableWindow(uid);
            if (!dw.IsVisible())
                dw.Show(true);
        }


- Compile the code, rum ArcMap, put the button on Toolbar.
- Click on button! The webbrowser dock windows is visible.
- Move the web browser window (dock and undock, change position) and the ArcMap freeze.

What's wrong with the code?
ArcMap SP3, and ArcObject .NET SP3 too.

The web browser sample from ESRI sometimes freeze too.
0 Kudos
1 Reply
MLowry
by
Occasional Contributor II
For posterity/curiosity sake,

the machine that was malfunctioning, was it Win7 x64 with IE v.8 or v.9?

the machine that worked correctly, was it Win7 x64 and what version of IE installed?

There is a known bug with Win7 x64, with dockable windows, with verison 9 IE installed. Even with 10.0 SP3 installed, I can crash ArcMap on demand with the Search window tab docking.

Esri is long overdue for a whole re-write of the COM-architecture of their platform.
0 Kudos