Guys,
We have a .Net 2 Windows forms app using Infragistics 2008 v2 controls extensively, including the MDI tab manager and combo controls.We are seeing occasionally crashing in the UltraComboEditor as below. We can't reproduce it easily currently, but it seems to happen on slow machines which are either very busy or have a poor wireless connectivity. It looks like some sort of timing problem. This problem is causing disquiet amongst our users so we need to find a solution or workaround.
It looks identical to a problem someone reported in 2005 at http://news.archive.infragistics.com/readmessage?id=%3C43983 1d4$1@mailgw.shersoft.com%3E&group=infragistics.products.netadvantage.windowsforms.wineditors but this was obviously a much older version of of the control library Any help appreciated.
Mark-----------------------------------
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.Win.EmbeddableTextBox.SetFont(AppearanceData& appData, Control owningControl) at Infragistics.Win.EmbeddableTextBox.ApplyAppearance(AppearanceData appData) at Infragistics.Win.EmbeddableTextBox.Initialize(EmbeddableUIElementBase owningElement) at Infragistics.Win.EditorWithText.DisplayTextBox() at Infragistics.Win.EditorWithCombo.DisplayTextBox() at Infragistics.Win.EditorWithText.OnBeforeEnterEditMode(Boolean& cancel) at Infragistics.Win.EmbeddableEditorBase.EnterEditMode(EmbeddableUIElementBase embeddableElement) at Infragistics.Win.UltraWinEditors.TextEditorControlBase.OnEnter(EventArgs e) at Infragistics.Win.UltraWinEditors.UltraComboEditor.OnEnter(EventArgs e) at System.Windows.Forms.Control.NotifyEnter() at System.Windows.Forms.ContainerControl.UpdateFocusedControl()
************** Loaded Assemblies **************mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------Issue891 Assembly Version: 5.0.0.893 Win32 Version: 5.0.0.893 CodeBase: file://moderngovsvr/mgClient/Issue891.exe----------------------------------------System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------Microsoft.VisualBasic Assembly Version: 8.0.0.0 Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll----------------------------------------Microsoft.VisualBasic.Compatibility Assembly Version: 8.0.0.0 Win32 Version: 8.0.50727.1433 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic.Compatibility/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.Compatibility.dll----------------------------------------Infragistics2.Win.v8.1 Assembly Version: 8.1.20081.1000 Win32 Version: 8.1.20081.1000 CodeBase: file://moderngovsvr/mgClient/Infragistics2.Win.v8.1.DLL----------------------------------------Infragistics2.Win.UltraWinToolbars.v8.1 Assembly Version: 8.1.20081.1000 Win32 Version: 8.1.20081.1000 CodeBase: file://moderngovsvr/mgClient/Infragistics2.Win.UltraWinToolbars.v8.1.DLL----------------------------------------Infragistics2.Shared.v8.1 Assembly Version: 8.1.20081.1000 Win32 Version: 8.1.20081.1000 CodeBase: file://moderngovsvr/mgClient/Infragistics2.Shared.v8.1.DLL----------------------------------------Infragistics2.Win.UltraWinTabbedMdi.v8.1 Assembly Version: 8.1.20081.1000 Win32 Version: 8.1.20081.1000 CodeBase: file://moderngovsvr/mgClient/Infragistics2.Win.UltraWinTabbedMdi.v8.1.DLL----------------------------------------System.Design Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll----------------------------------------Scripting Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file://moderngovsvr/mgClient/Scripting.DLL----------------------------------------Infragistics2.Win.Misc.v8.1 Assembly Version: 8.1.20081.1000 Win32 Version: 8.1.20081.1000 CodeBase: file://moderngovsvr/mgClient/Infragistics2.Win.Misc.v8.1.DLL----------------------------------------Infragistics2.Win.UltraWinEditors.v8.1 Assembly Version: 8.1.20081.1000 Win32 Version: 8.1.20081.1000 CodeBase: file://moderngovsvr/mgClient/Infragistics2.Win.UltraWinEditors.v8.1.DLL----------------------------------------System.Data Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll----------------------------------------System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll----------------------------------------System.Transactions Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll----------------------------------------System.EnterpriseServices Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll----------------------------------------Word Assembly Version: 8.1.0.0 Win32 Version: 8.1.0.0 CodeBase: file://moderngovsvr/mgClient/Word.DLL----------------------------------------Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll----------------------------------------Infragistics2.Win.UltraWinStatusBar.v8.1 Assembly Version: 8.1.20081.1000 Win32 Version: 8.1.20081.1000 CodeBase: file://moderngovsvr/mgClient/Infragistics2.Win.UltraWinStatusBar.v8.1.DLL----------------------------------------Keyoti.RapidSpell.NET2 Assembly Version: 3.7.0.3110 Win32 Version: 3.7.0.3110 CodeBase: file://moderngovsvr/mgClient/Keyoti.RapidSpell.NET2.DLL----------------------------------------
************** JIT Debugging **************To enable just-in-time (JIT) debugging, the .config file for thisapplication or computer (machine.config) must have thejitDebugging value set in the system.windows.forms section.The application must also be compiled with debuggingenabled.
For example:
<configuration> <system.windows.forms jitDebugging="true" /></configuration>
When JIT debugging is enabled, any unhandled exceptionwill be sent to the JIT debugger registered on the computerrather than be handled by this dialog box.
Hi Mark,
I'm afraid I don't have any great magic fix for you here. But I do have a suggestion that might help.
From the call stack here, it appears that the crash is occurring when the UltraTextEditor is entered.What happens is that when the UltraTextEditor gets focus, it creates a derived Microsoft TextBox control and positions it over itself to allow the user to edit. This gives the user all the built-in functionality of the Windows TextBox without us here at Infragistics having to re-invent the wheel so to speak.
Before the TextBox gets displayed, the UtraTextEditor sets it up to look the same (or as close as possible) to the UltraTextEditor. So it looks like it's failing when it tries to apply the font to it. I don't know why that would happen. It seems like setting the Font on a TextBox would be a no-brainer operation. I know that there are some strange issues with TextBoxes that sometime setting certain properties on them causes them to get re-created, so we sometimes have to be careful about the order in which certain properties are set. But in this case, there's not much to go on in terms of figuring out what the problem is.
Anyway, since the problem is occuring on the showing of the TextBox, you can cut down significantly on the number of times this process occurs by setting the AlwaysInEditMode property to true. With this property set, you will lose a little bit of functionality on the control. It won't draw text using GDI+ (it will use GDI instead) and it won't be able to display gradients or hash brushes (but you probably aren't using those on a TextBox, anyway). The up side is that the control will enter edit mode the first time it paints and stay that way forever, so it will not continuously be showing and hiding the TextBox every time it gains and loses focus.
Hopefully, that will avoid, or at least significantly reduce, the occurrance of whatever error is happening here.
Mike
Thanks for the speedy reply. We will give this a go - certainly twe aren't worried about the functional inpact.
Mark
We have subsequently discovered that, due to issues with the way we have migrated from windows controls to infragistics, and the way we integrate changes onto our master source code, at least one of the problem forms was missing is BeginInit / EndInit cals for the problem combo.
We not sure if this is the problem, but it might well make sense.
Doh!
I can't be sure, but it is conceivable that that could cause a problem. If so, then the easiest things to do to fix it is to just dirty the form designer so that the code gets re-generated automatically.
MIke
Many thanks for your time and honestly.
That's a good point and you are absolutely right. I took a look at the code and there is really only one line of code in the SetFont method that could possibly raise a NullReferenceException. So I fixed this.
If you to be notified when the Hot Fix is available, you should Submit an incident to Infragistics Developer Support. Give them a link to this forum post and tell them the bug number is 8817 and ask them to notify you when the fix is released.
Yes, I suspect it will be difficult reproduce. Right now our exception handling seems to resolve the problem, so investing more of our time and money in helping you improve your code is not really justified.
If what we experience isn't at all a common issue, I can understand your team not wishing to investigate. On the other hand we are not the only people to have ever seen or reported this error, given the link to the identical stack trace reported in 2005.
If this were my problem, I would spend half an hour looking at the code and consider tightening up the error handling at this point. But this is your reputation at issue, not mine. I have managed to patch up my reputation now.
I worked once on big project where I spotted a fundamental issue that would scupper a large part of what they were doing. I submitted this as a comment on their incident tracking system. This then because 'my problem', and they would only address it if I produced a full justification. Of course, it was their problem, and they were the ones to ultimately suffer.
Thanks for the prompt responses anyway,
Well, if you can duplicate the problem in a small sample project, you can Submit an incident to Infragistics Developer Support.
It sounds like that will probably be difficult or impossible in this case, but maybe you could simulate the timing issue somehow with a tight loop. Unfortunately, there isn't much we can do without being able to duplicate the issue.
Mike,
Thanks. Dirty-ing each fofm was what we did. Alas, that didn't seem to help at all.
The switch to always-in-edit-mode seemed to improve things, but we tend to find the text in the combos often ends up highlighted when the form is displayed, even when it doesn't have focus. This sort of problem existed previously with the native VB combos. We can fix it with code to clear the selection on the combos, but this is a pain..
In the end we subclassed the infragsitics combo and put an exception handler in for the OnEnter event. This seems to do the trick. Long live OO.
Everything points to this being a problem with the Infragistics control. It seems to be a timing problem that only occurs when the PC / network is under particular load.
ThanksMark