It appeares the "MouseEventArg e" is sometimes passed as null to...Infragistics.Win.UltraWinChart.UltraChart.SendEvents(Primitive p, MouseEventArgs e) causing the crash (about 1 in 6) on our testing (using middle mouse button)After I make some source changes in UltraChart.cs, that moves the base.OnMousedown() to after the Tools.MouseDown, the Mouse arguments are no longer randomly null in SendEvents
Below I have included my chages to UltraChart.cs:OnMOuseDown line 5967 protected override void OnMouseDown(MouseEventArgs evt) { this.lastInput.ViewPoint = new Point(evt.X, evt.Y); this.lastInput.Buttons = evt.Button; this.lastInput.Modifiers = Control.ModifierKeys; this.lastInput.MouseEventArgs = evt; if (this.AcceptsFocus) { // RequestFocus(); //MAC crash in UltraChart.SendEvents originate here //System.NullReferenceException: Object reference not set to an instance of an object. //at Infragistics.Win.UltraWinChart.UltraChart.SendEvents(Primitive p, MouseEventArgs e) //at Infragistics.Win.UltraWinChart.DefaultTool.MouseDown() //at Infragistics.Win.UltraWinChart.UltraChart.OnMouseDown(MouseEventArgs evt) //at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) //MAC I belive base.OnMouseDown should be after Tool.Mousedown because //MAC sometimes evt is null inside SendEvents(p,e) //MAC garbage collection? //base.OnMouseDown(evt); //MAC this.Tool.MouseDown(); //MAC base.OnMouseDown(evt); //MAC } this.lastInput.MouseEventArgs = null; }
mac,
sorry for the delay, the dev team has been going full steam on our next volume release, and this was not a question the support team could have helped with.
in fact, base.OnMouseDown used to be called after this.Tool.MouseDown in an older version, but we had to change it due to some issues with focus in MDI applications.
i think i would be more comfortable detecting the error from DefaultTool.MouseDown() and avoiding the exception from there.
do you have any idea what's special about the 1 in 6 machines that produce this exception?
Sorry David, i have not replied sooner was away doing other things :¬(
I actualy meant 1/6 times the middle button was used inside the program and this tested on various machines.
This led me to belive the variable had been garbage collected due to the order of those 2 lines of code., but again I dont l know your gode as good as yourselves
I had 2 choices
Too wrap a catch around the null exception and make like it didnt happen (anoy the users) or to reverse the order of those calls in the source code - I chose the latter
thanks :¬)