Bug Report T294256
Visible to All Users

NullReferenceException is raised in the DocumentManagerUIViewRegularDragListener.OnDrop method in certain circumstances

created 9 years ago

Hi!

We use the document manager with the dock manager in our forms. In production, it happens sometimes that users are able to create an unhandled exception "Reference not set to an instance of an object." when they drag documents. Here is the stack trace :

DevExpress.XtraBars.Docking2010.Dragging.DocumentManagerUIViewRegularDragListener.OnDrop(Point point, ILayoutElement element)
DevExpress.XtraBars.Docking2010.DragEngine.DragServiceState.DoDrop(IUIView view, Point point, OperationType type)
DevExpress.XtraBars.Docking2010.DragEngine.DockingDragServiceState.ProcessMouseUp(IUIView view, Point point)
DevExpress.XtraBars.Docking2010.DragEngine.DragService.ProcessMouseCore(IUIView processor, Point screenPoint, MouseEventType eventType, MouseEventArgs e)
DevExpress.XtraBars.Docking2010.DragEngine.DragService.ProcessMouseOverride(IUIView view, MouseEventType eventType, MouseEventArgs ea)
DevExpress.XtraBars.Docking2010.DragEngine.UIService.ProcessMouse(IUIView view, MouseEventType eventType, MouseEventArgs ea)
DevExpress.XtraBars.Docking2010.DragEngine.UIViewAdapter.ProcessMouseEvent(IUIView view, MouseEventType eventType, MouseEventArgs ea)
DevExpress.XtraBars.Docking2010.DragEngine.MouseEventSubscriber`1.RootUIElementMouseUp(Object sender, MouseEventArgs e)
System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
System.Windows.Forms.Control.WndProc(Message& m)
DevExpress.XtraBars.Docking2010.DocumentsHost.WndProc(Message& m)
System.Windows.Forms.Control+ControlNativeWindow.OnMessage(Message& m)
System.Windows.Forms.Control+ControlNativeWindow.WndProc(Message& m)
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Unfortunately, we are unable to reproduce it at will. I send you the stack trace in case you could understand what is happening. It happens enough often to bother users and it is hard to tell them we cannot do anything for that.

Thanks!
Benoit

Comments (3)
DevExpress Support Team 9 years ago

    Hi Benoit,

    While we can't reproduce this issue on our side as well, we checked this call stack and see some places we can improve. Though I can't guarantee that this will resolve the issue, but request a hotfix for this ticket and test it on your side. Let me know your results.

    C C
    Chris Carter - EMI 9 years ago

      I hope the hotfix below fixes the issue, I'm not sure how to reproduce this myself but I got this in a few times from users.  Thankfully the exception system takes screens of all the active forms so I can at least show what appears to be happening.  I also cannot reproduce this at all, and the screen shown in this image is using both a document manager for the charts and a dock manager for many toolboxes used to manipulate the data surrounding the chart.  In this case I'm not sure if the dock was initiated by the dock control or the document manager but I do have the exception.  Hope this helps!
      System.NullReferenceException: Object reference not set to an instance of an object.
        at DevExpress.XtraBars.Docking2010.Dragging.DocumentManagerUIViewRegularDragListener.OnDrop(Point point, ILayoutElement element)
        at DevExpress.XtraBars.Docking2010.DragEngine.DragServiceState.DoDrop(IUIView view, Point point, OperationType type)
        at DevExpress.XtraBars.Docking2010.DragEngine.FloatingMovingDragServiceState.ProcessMouseUp(IUIView view, Point point)
        at DevExpress.XtraBars.Docking2010.DragEngine.DragService.ProcessMouseCore(IUIView processor, Point screenPoint, MouseEventType eventType, MouseEventArgs e)
        at DevExpress.XtraBars.Docking2010.DragEngine.DragService.ProcessMouseOverride(IUIView view, MouseEventType eventType, MouseEventArgs ea)
        at DevExpress.XtraBars.Docking2010.DragEngine.UIService.ProcessMouse(IUIView view, MouseEventType eventType, MouseEventArgs ea)
        at DevExpress.XtraBars.Docking2010.DragEngine.UIViewAdapter.ProcessMouseEvent(IUIView view, MouseEventType eventType, MouseEventArgs ea)
        at DevExpress.XtraBars.Docking2010.Dragging.BaseFloatFormUIView.EndExternalDragging(Point screenPoint)
        at DevExpress.XtraBars.Docking2010.Views.FloatDocumentCollection.<>c__DisplayClass2.<EndDragging>b__0()
        at DevExpress.XtraBars.Docking2010.Views.FloatDocumentCollection.EndDragging(Form form, Point screenPoint)
        at DevExpress.XtraBars.Docking2010.Views.FloatDocumentCollection.ProcessDragging(dragging action, Form form)
        at DevExpress.XtraBars.Docking2010.Views.FloatDocumentCollection.ProcessWindowDragging(Int32 Msg, Form floatForm)
        at DevExpress.XtraBars.Docking2010.Views.FloatDocumentCollection.PreFilterMessageCore(Int32 Msg, Control wnd, IntPtr HWnd, IntPtr WParam, IntPtr LParam)
        at DevExpress.XtraBars.Docking2010.Views.BaseDocumentCollection.DevExpress.Utils.Win.Hook.IHookController.InternalPreFilterMessage(Int32 Msg, Control wnd, IntPtr HWnd, IntPtr WParam, IntPtr LParam)
        at DevExpress.Utils.Win.Hook.HookManager.InternalPreFilterMessage(HookInfo hInfo, Int32 Msg, Control wnd, IntPtr HWnd, IntPtr WParam, IntPtr LParam)
        at DevExpress.Utils.Win.Hook.HookManager.MouseHook(Int32 ncode, 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.Form.DefWndProc(Message& m)
        at System.Windows.Forms.Control.WndProc(Message& m)
        at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
        at System.Windows.Forms.ContainerControl.WndProc(Message& m)
        at System.Windows.Forms.Form.WmSysCommand(Message& m)
        at System.Windows.Forms.Form.WndProc(Message& m)
        at DevExpress.XtraEditors.XtraForm.WndProc(Message& msg)
        at DevExpress.XtraBars.Ribbon.RibbonForm.WndProc(Message& msg)
        at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
        at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
        at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

      DevExpress Support Team 9 years ago

        Hi Chris,

        We introduced changes in our code without reproducing this issue on our side. But I don't see what may be the cause of the issue based on the provided screenshot. If this fix does not work for you, handle the AppDomain.UnhandledException event in the following way:

        C#
        [STAThread] static void Main() { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }

        The Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException); line is important. In the UnhandledException event handler, display a message to a user to collect a dump file for the error. For example:

        C#
        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { MessageBox.Show("Collect Dump"); }

        Once a user sees this message, ask them to collect a dump file. They can do this in the Task Manager as described in the How to create a user-mode process dump file in Windows Vista and in Windows 7 article. Once the dump file is obtained, ask your user to provide you with that file and then send it to us for research.

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)
          JS JS
          Jürgen Scheffler 6 years ago

            Hi,

            the Thread is 4 years old. We have 15.1.6.0 installed and the link to the hotfix 15.1.8 is not correct anymore. Where do I find ich or do I have to install sth like 15.2+?

            DevExpress Support Team 6 years ago

              Hi,
              You cannot get a hotfix since the minor version, where this issue was fixed, is released. So, the best solution is to upgrade your components to version 15.1.8 or newer. You can do it using our download manager.
              I hope it will be helpful.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.