DockableWindow FAIL when I try to distribute my Addin

565
7
01-26-2011 09:58 AM
BlaiseMacLean
New Contributor III
I haven't done anything with GIS in about 10 years.  Now I'm trying to build an Addin to ArcMap.  The plan is to create a toolbar and then when a user clicks on my toolbar icon load up a Dockable Window for the user.  All works fine in the dev environment on my machine.  I built the solution and put the ESRI Addin file on a network server.  The user double clicks the Addin file and is able to successfully install the Addin.  Then we enable my toolbar (comes up without the images; just text but I don't care about that yet).  When I press the icon that should load up my Doc Window it crashes ArcMap.  I get the completely useless "ArcGIS Desktop has encountered a serious error...." and it gives me the option to send the issue to ESRI.  I've put msgboxes in there to see how far it gets and it seems to crash in the GetDockableWindow function at the Return line.  Any help with the problem or even on how I can debug this would be appreciated.

Thanks, Blaise

Code:
--------
    Private Sub ShowDockWindow()

        Dim dockWindow As ESRI.ArcGIS.Framework.IDockableWindow
        dockWindow = GetDockableWindow()

        If dockWindow Is Nothing Then
            Return
        End If

        dockWindow.Show(True)

    End Sub

    Private Function GetDockableWindow() As ESRI.ArcGIS.Framework.IDockableWindow

        Try
            ' Only get/create the dockable window if they ask for it
            Dim dockWinID As UID = New UIDClass()
            dockWinID.Value = Civic_Editor_AddIn.My.IDs.docwinCivicEditor
            '"CBRM_Civic_Editor_AddIn_docwinCivicEditor"

            Return My.ArcMap.DockableWindowManager.GetDockableWindow(dockWinID)

        Catch
            Return Nothing
        End Try

    End Function
0 Kudos
7 Replies
by Anonymous User
Not applicable
The value you pass to the UID.Value property does not seem to be in the right format. You should pass a string value representing either the ProgId or GUID of your class that implements the IDockableWindowDef interface.
So for example:
edit.Value = "esriCore.EditTool";

or
edit.Value = "4CEF30AE-44CA-4FCD-923F-D3F04CD0A407";
0 Kudos
BlaiseMacLean
New Contributor III
Thanks for the reply.  I had tried hard coding the value as you suggest.  Sorry I didn't include that info in the original post; I tend to be too long winded. 

I still have the same problem; it doesn't show my doc window and I get the "ArcGIS has encountered a serious error..." message and ArcMap crashes.

Here's my modified code:
    Private Function GetDockableWindow() As ESRI.ArcGIS.Framework.IDockableWindow

        Try
            Dim dockWinID As UID = New UIDClass()
            dockWinID.Value = "{80CA38D8-B818-4438-EF9E-871EAAE1C3EE}"

            Return My.ArcMap.DockableWindowManager.GetDockableWindow(dockWinID)

        Catch
            Return Nothing
        End Try

    End Function
0 Kudos
BlaiseMacLean
New Contributor III
It seems to be because I have Infragistics controls on my doc window.  The user has a desktop application with all the same Infragistics controls so I assumed he'd already have all of the required .dll files.  But when I remove all of the Infragistics controls from my doc window then it will display on the user's machine for me.

So I figured, great - I just have to stick all the necessary .dll files on his machine somewhere.  That didn't work though.

Questions: 
1.  Should I be able to use third party controls like Infragistics or should I try to go back to the standard controls?
2.  If yes for question 1 then how do I make it work?

Tia,

Blaise
0 Kudos
LukeBadgerow
New Contributor
I'm having issues displaying the form/ contents of my DW, but I'm not crashing the instance of arcMap.

What I see different between what you've got an what I'm working with (aside from language)...

I'm splitting the GetID completely from the .Show()

        internal static UIDClass GetID()
        {
            var id = new UIDClass();
            id.Value = "My_Totally_Not_Working_DockableWindow";
            return id;
        }

        internal static void Show(bool show)
        {
            IDockableWindow dw = ArcMap.DockableWindowManager.GetDockableWindow(GetID());

            dw.Show(show);
        }


so basically I'm going and getting it's ID as the text (as stored in my config.xml) then calling that method to pass the CLSID to the .GetDockableWindow() method.

I hope this helps.
0 Kudos
by Anonymous User
Not applicable
Third party controls on dockable windows should be possible, I do it all the time.
I can't see from here where things go wrong. What I often when I get stuck on such a problem is to start again with a simple clean piece of code. Try implementing the dockable window sample from the developer help. If that window is loaded, add your controls and code step by step.
0 Kudos
BlaiseMacLean
New Contributor III
I've replaced all of the infragistics controls with standard windows form controls.  I tried to deploy many times with different infragistics controls (a label or a button or a textbox) to see if it was a particular control giving me trouble.  But it was all infragistics controls; so I just replaced them all.  It was painful and my gui won't be as nice looking but I'm on a timeline.

We can consider this issue closed (not solved but closed).

Thanks for your replies.

Blaise
0 Kudos
sudhanshchinta
New Contributor
I have a similar issue but I built my Dockable window with standard winform controls. But when I hit the DockableWindow manager in the code it shows null and throws exception.

Any suggestions please.
0 Kudos