I have two forms, one is an MDI parent, and the other is the client. The parent has a MainFrameBarManager created at design time, and the child has a ChildFrameBarManager, created at runtime and stored as a generic BarManager. Everything works fine until I go to close the form, then an exception is thrown from the bowels of the barmanager code:
Key cannot be null.
Parameter name: key
at System.Collections.Hashtable.get_Item(Object key)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarManager.GetManagerFromForm(Form form)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarManager.GetManagerFrom(Form form)
at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.UpdateBars()
at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.OnFormDeactivated(Form form, Boolean updateBars)
at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.set_LatestActiveMdiChild(Form value)
at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.OnFormClosed(Form form)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarManager.FormClosed(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnClosed(EventArgs e)
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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(IntPtr hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam)
at System.Windows.Forms.Form.Close()
at Syncfusion.Windows.Forms.Tools.XPMenus.MdiSysMenuProvider.DestroyMDIActiveChild()
at Syncfusion.Windows.Forms.Tools.XPMenus.MdiSysMenuProvider.HandleMouseUp(Point ptclient)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarControlInternal.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.NativeWindow.WndProc(Message& m)
at Syncfusion.Windows.Forms.Tools.XPMenus.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at TecoloteResearch.POST.SelfHost.Activate() in C:\ITG\Projects\ACEIT\POST\Source\POST\Classes\SelfHost.vb:line 76
I am using the new 1.5.1.1; I patched a full 1.5.0.0 install this morning.
One interesting thing that I noted is that previously the constructor was being called twice (I saw the explanation in a previous post, although I think it is very lame that it does this). However, now the constructor is only being called once. I did not notice if this was because of the change to 1.5.1.1, or if it is maybe because of something that I did.
I am pretty sure that I am calling all of the same things as before; I basically took all of the code from InitializeComponent and moved it into the constructor, right after the call to InitializeComponent. The same calls are being made, and in the same order, so it seems like everything should work.
- Steve