I am showing a Visual Studio toolwindow in this way. It worked some time ago, but now it doesn’t work anymore.
Dim vsUIShell As IVsUIShell = DirectCast(Package.GetGlobalService(GetType(SVsUIShell)), IVsUIShell)
Dim frame As IVsWindowFrame
Dim guidToolWindow2 As Guid = GetType(ViewIssueDetailsWindow).GUID
vsUIShell.FindToolWindow(CUInt(__VSFINDTOOLWIN.FTW_fForceCreate), guidToolWindow2, frame)
frame.SetProperty(CInt(__VSFPROPID.VSFPROPID_FrameMode), VSFRAMEMODE.VSFM_MdiChild)
frame.Show()
It’s giving me a null reference exception, saying that “frame” is not set to an instance of an object. So something obviously goes wrong with the FindToolWindow function or the GUID.
I don’t know much about GUIDs. All I know is that all this worked a few days ago.
Here’s my tool window defined:
<Guid("cb7fcd51-f6ba-498b-87fc-693b79cf7c92")> _
Public Class ViewIssueDetailsWindow
Inherits ToolWindowPane
Public Sub New()
MyBase.New(Nothing)
' Set the window title reading it from the resources.
Me.Caption = "Issue tracker"
Me.Content = New IssueDetailsControl()
End Sub
End Class
The GUID of my main window was “cb7fcd51-f6ba-498b-87fc-693b79cf7c91”, so to make the GUID for this one, I specified “cb7fcd51-f6ba-498b-87fc-693b79cf7c92” (a 2 instead of a 1 at the end). Was that incorrect?
It worked for a while.
Any ideas?
I got this resolved by reinstalling Visual Studio, and the Visual Studio SDK as well.