We have an MDI application that uses an UltraTree object to display hierarchical functions to user. About a month ago, we upgraded our Infragistics components to the latest release, 11.2 CLR 4.0, SR 2028.
We're now experiencing a random error, that appears during mouse operations (mouse move, mouse click) on UltraTree, and that is intercepted by OS as an Unhandled exception:
System.ObjectDisposedException: Cannot access a disposed object.Object name: 'ToolTipFormEx'. at System.Windows.Forms.Control.CreateHandle() at System.Windows.Forms.Form.CreateHandle() at Infragistics.Win.ToolTipForm.CreateHandle() at System.Windows.Forms.Control.RecreateHandleCore() at System.Windows.Forms.Form.RecreateHandleCore() at Infragistics.Win.ToolTipFormEx.set_DisplayShadow(Boolean value) at Infragistics.Win.ToolTip.set_DisplayShadow(Boolean value) at Infragistics.Win.UltraWinTree.UltraTree.get_ToolTip() at Infragistics.Win.UltraWinTree.UltraTreeNode.ShowTooltipIfNeeded() at Infragistics.Win.UltraWinTree.UltraTree.OnMouseEnterElement(UIElementEventArgs e) at Infragistics.Win.UltraControlBase.Infragistics.Win.IUltraControl.FireMouseEnterElement(UIElementEventArgs e) at Infragistics.Win.ControlUIElementBase.ElementEntered(UIElement element, Boolean triggerMouseLeavesOnly) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, mouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraWinTree.UltraTree.OnMouseMove(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseMove(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) 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)
Could you please help us to avoid this behaviour? If you need details, please ask.Thanks!
Michael,it is difficult to post a sample application, since in both cases the issue is appearing randomly.
I agree with Mike (btw, thank you for your response! :) ) that the problem could be related to 11.2 version, as we never saw it with any previous release.
I also noticed that the problem could be caused by updating the current application's skin (we have a combo that allows the user to change app appearance at run time) and then move the mouse over the tree.
I think we cannot use the solution suggested by Mike in a production environment, because it's a workaround to avoid the error being shown to the user. It doesn't guarantee that the application still remains in a correct state, once the error occurred. As Mike said, sometimes a red X replaces the tree and the application must be restarted.
I have not been able to reproduce this issue. Would you be able to post here a sample application that reproduces the issue on your end so that I could test it here? Have you tried the work-around that was suggested here on this forum thread?
We are also experiencing this problem.We never saw this with older versions of the Tree control so this looks like a regression in 11.2.(We use CLR 3.5 not 4.0 however)
One way that will often create the problem is to change the application appearance.If we apply a different isl file and then move the mouse over the tree the error usually occurs.
The stack trace we get is identical to the one reported above.
Our TopLevel exception handler is able to catch the exception and in most cases this allows the app to continue without problems - other than a message box to report the error. Occasionally however the Tree control is replaced by a large red X - in which case the user must close the app and restart it
As a workaround you can add a TopLevel exception handler to your app as follows:
AddHandler Application.ThreadException, AddressOf TopLevelErrorHandler
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException)
Private Sub TopLevelErrorHandler(ByVal sender As Object, ByVal e As System.Threading.ThreadExceptionEventArgs) 'Try to handle any UI exception that did not have its own exception handler Try If Not e.Exception.Message.Contains("ToolTipFormEx") Then _ MessageBox.Show(e.Exception.ToString) Catch End Try End Sub
Mike