GetDockableWindow() not working in Release 10

463
6
07-16-2010 09:02 AM
BillMacPherson
New Contributor III
I'm working with the ESRI sample:
Simple logging dockable window with a custom context menu
http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/e439cf8c-778b-4fdb-b4c4-fab51a546ac6.htm

I am able to use it with 9.3.1 but not with ArcGIS release 10.

The call to GetDockableWindow() returns nothing in release 10.

I'm using vs2008 with MS .Net Framework 3.5 sp1

Is there a step I'm missing for version 10 of ArcGIS?

Thanks,

    Private Sub SetupDockableWindow()
        If m_dockableWindow Is Nothing Then
             Dim dockWindowManager As IDockableWindowManager
             dockWindowManager = CType(m_application, IDockableWindowManager)
             If Not dockWindowManager Is Nothing Then
                  Dim windowID As UID = New UID
                  'Dim windowID As UID = New UIDClass
                  windowID.Value = DockableWindowGuid
                  m_dockableWindow = dockWindowManager.GetDockableWindow(windowID)
                  If m_dockableWindow Is Nothing Then
                        MsgBox("m_dockableWindow is Nothing", MsgBoxStyle.Exclamation, "Bummer")
                  End If
             End If
        End If
    End Sub
0 Kudos
6 Replies
BillMacPherson
New Contributor III
I found the same esri sample but this one is for ArcGIS 10.0 and it works! Awesome...

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/00010000048s000000.ht...
0 Kudos
EagerIp
New Contributor II
The reason the 9.3 sample doesn't work is at 10 you need to register custom component differently, i.e. using esriRegasm.exe, which is incorporated in the 10 sample.

Check out http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#Register for more information.
0 Kudos
BillMacPherson
New Contributor III
I was able to successfuly incorporate the dockable window into my custom component. It was working fine. Then, I copied the visual studio solution to a different development computer and now the GetDockableWindow() call returns nothing. The dockable window is part of my custom component, it is not a separate dll or assembly. It seems like the guid for the dockable window got lost somewhere.

Any ideas?

Do I need to remove the dockable window (user control) from my project and re-add it?
0 Kudos
EagerIp
New Contributor II
I was able to successfuly incorporate the dockable window into my custom component. It was working fine. Then, I copied the visual studio solution to a different development computer and now the GetDockableWindow() call returns nothing. The dockable window is part of my custom component, it is not a separate dll or assembly. It seems like the guid for the dockable window got lost somewhere.

Any ideas?

Do I need to remove the dockable window (user control) from my project and re-add it?


Did you run Clean to your solution after moving it or do a Rebuild? If you just copy the project over along with the compiled binary on another machine and just run build, Visual Studio may assume the project is up-to-date so it won't regenerate the dlls and esriRegasm won't be run to register the extra component.
0 Kudos
BillMacPherson
New Contributor III
I tried running Clean Solution before the new build and it made no difference.

I noticed a difference when I build the simple dockable window sample and my project. The sample runs esriRegasm.exe on the dll when it is finished and mine does not. The ouput window results are shown below for both project compiles.

This has never been an issue before. I have been working on this dll for several years and multilple ArcGIS upgrades.

But, could this be the problem? If it is the problem, how is esriRegasm getting executed because I can't find any difference in the sample code and mine? Is there something that forces the execution of esriRegasm?


------ Build started: Project: SimpleLogWindowVB2008, Configuration: Release Any CPU ------
SimpleLogWindowVB2008 -> C:\...\VBNet\bin\Release\SimpleLogWindowVB.dll
esriRegasm.exe "C:\...\VBNet\bin\Release\SimpleLogWindowVB.dll" /p: Desktop /s
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========


------ Build started: Project: AddressingEditorTools, Configuration: Release Any CPU ------
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Vbc.exe /noconfig ...
AddressingEditorTools -> C:\...\Addressing\bin\Release\AddressingEditorTools.dll
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

Thanks,
Bill
0 Kudos
EagerIp
New Contributor II
The ArcGIS 10.0 registration step is performed at the build process so you won't see anything in your source code files. Instead the project file needs to be updated. The following migration help topic should help solving the problem.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Migrating_ArcGIS_9_3_De...

And check out the "Register ArcGIS Desktop custom components > ESRIRegasm" section
0 Kudos