We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Null reference when closing form

When I close my main MDI form with several XP bars on I occasionally get the following exception. Any Idea what the problem may be here? System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Tools.XPMenus.MdiClientNativeWnd.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam) at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, Int32 lparam) at System.Windows.Forms.Form.Select(Boolean directed, Boolean forward) at System.Windows.Forms.Control.SelectNextControl(Control ctl, Boolean forward, Boolean tabStopOnly, Boolean nested, Boolean wrap) at System.Windows.Forms.ContainerControl.AfterControlRemoved(Control control) at System.Windows.Forms.Form.AfterControlRemoved(Control control) at System.Windows.Forms.ControlCollection.Remove(Control value) at System.Windows.Forms.ControlCollection.Remove(Control value) at Syncfusion.Windows.Forms.Tools.CommandBarController.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at Syncfusion.Windows.Forms.Tools.XPMenus.CommandBarManager.Dispose(Boolean disposing) at Syncfusion.Windows.Forms.Tools.XPMenus.CommandBarManager.Dispose() at Syncfusion.Windows.Forms.Tools.XPMenus.BarManager.Dispose(Boolean disposing) at Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager.Dispose(Boolean disposing) at System.ComponentModel.Component.Dispose() at System.ComponentModel.Container.Dispose(Boolean disposing) at System.ComponentModel.Container.Dispose() at Sigma.Matrics.Forms.FormMain.Dispose(Boolean disposing) in c:\kjetil\vs\matrics\forms\formmain.cs:line 95 at System.ComponentModel.Component.Dispose() 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)

4 Replies

AD Administrator Syncfusion Team June 20, 2005 04:58 AM

P.S. I am using version 3.2.1.0


AD Administrator Syncfusion Team June 20, 2005 04:39 PM

Hi Kjetil, This is a known problem with XPMenus in v3.2.1.0 It has been corrected internally, and the fix is available in a private patch (v3.2.1.1) that can be requested through DirectTrac. I apologize for any inconvenience this may cause. Regards, Gregory Austin Syncfusion Inc.


AD Administrator Syncfusion Team June 21, 2005 04:44 AM

The exception is thrown when my main form is disposed. After this the application is always closed down anyway. I have tried to put a try-catch handler around the dispose statement, and this avoids the exception being shown to the user. If I can trust Windows to clean up afterwards, when the application has closed this basically solves the problem. Do you think this is OK? I am not very eager to upgrade with an internal patch since I use a lot of the products in the Syncfusion studio and I am afraid that this may break something else.


AD Administrator Syncfusion Team June 21, 2005 08:35 AM

Hi Kjetil, That workaround should work fine. Regards, Gregory Austin Syncfusion Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon