Posted 19 years ago
by Boyd
-
Sr. Software Developer,
Patterson Consulting, LLC
Before I try to track this issue down into a sample application, I thought I'd go ahead and post this to see if you know what's causing it.
I have a DockManager control that is located within a UserControl which is hosted in a ToolWindow controlled by a parent DockManager control... get all that? :) ... basically, it's just a DockManager instance in a ToolWindow.
When my application is shutting down, I save the DockManager layout of the instance in the ToolWindow prior to closing the ToolWindow. The following exception occurs when ToolWindow is not currently active:If the ToolWindow is active when I shut down, everything works fine. It's only when the ToolWindow is not active that I have this problem. Any theories before I try to build this in a sample app? Just trying to save some time on my end if you think you might know what's causing it.
A little background about the call stack... the 'ShuddownDockManager' method is called from the 'OnClosing' method of my main application. It then calls an 'OnApplicationClosing' method for each loaded ToolWindow and DocumentWindow. It's the 'OnApplicationClosing' process that is trying to save the layout.
Thanks!
I have a DockManager control that is located within a UserControl which is hosted in a ToolWindow controlled by a parent DockManager control... get all that? :) ... basically, it's just a DockManager instance in a ToolWindow.
When my application is shutting down, I save the DockManager layout of the instance in the ToolWindow prior to closing the ToolWindow. The following exception occurs when ToolWindow is not currently active:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at ᐛ.ᐁ(DockManager , XmlTextWriter )
at ActiproSoftware.UIStudio.Dock.DockManager.SaveToolWindowLayoutToFile(String path)
at ScriptEditor.ToolWindows.ObjectBrowser.OnApplicationClosing() in c:\visual studio projects\scripteditor\toolwindows\objectbrowser.cs:line 130
at ActiproSoftware.UIStudio.Dock.DockManagerContainer.ShutdownDockManager() in C:\Visual Studio Projects\PattersonConsulting\Shared\ActiproSoftware\UIStudio.Dock.cs:line 114
at ScriptEditor.MainForm.OnClosed(EventArgs e) in c:\visual studio projects\scripteditor\mainform.cs:line 234
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
A little background about the call stack... the 'ShuddownDockManager' method is called from the 'OnClosing' method of my main application. It then calls an 'OnApplicationClosing' method for each loaded ToolWindow and DocumentWindow. It's the 'OnApplicationClosing' process that is trying to save the layout.
Thanks!