Hi,
we are facing the "Parameter is not valid."
at System.Drawing.Graphics.GetHdc()
at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureTextGDIOrThemed(String text, Font font, TextFormatFlags textFormatFlags)
at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureCharacterRangesGDI(String text, Font font, TextFormatFlags textFormatFlags, CharacterRange[] ranges)
at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.ReMeasureParts(String text, Int32[] parts, Single[] widths, Int32 partStartIndex, Int32 partEndIndex, Font font, Single& lineHeight)
at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureParts(String text, Int32[] parts, Font font, Single& lineHeight)
at Infragistics.Win.FormattedLinkLabel.NodeText.TextLayoutInfo.Measure(PositionElementsInfo& info)
at Infragistics.Win.FormattedLinkLabel.NodeText.PositionSelf(PositionElementsInfo& info)
at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)
at Infragistics.Win.FormattedLinkLabel.NodeBase.Position(PositionElementsInfo& info)
at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionChildNodes(PositionElementsInfo& info)
at Infragistics.Win.FormattedLinkLabel.NodeBlock.PositionChildNodes(PositionElementsInfo& info)
at Infragistics.Win.FormattedLinkLabel.NodeBase.CalcSize(IFormattedLinkLabelOwner owner, Graphics graphics, Int32 maxWidth)
at Infragistics.Win.FormattedLinkLabel.ParsedFormattedTextValue.CalcSize(Graphics graphics, Font baseFont, AppearanceData& defaultAppearance, Int32 widthConstraint, DefaultableBoolean wrapText, GdiDrawStringFlags gdiDrawStringFlags)
at Infragistics.Win.UltraWinToolbars.Ribbon.RibbonMetrics.CalculateCaptionAreaHeight()
at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.CalculateGlassRect()
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.ExtendGlassIntoRibbon(IntPtr handle)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.RefreshGlass()
at Infragistics.Win.UltraWinToolbars.Ribbon.RibbonMetrics.Dirty(RibbonMetricsFlags flags)
at Infragistics.Win.UltraWinToolbars.Ribbon.OnFormCaptionChanged()
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.OnFormTextChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
at System.Windows.Forms.Form.OnTextChanged(EventArgs e)
at System.Windows.Forms.Control.set_Text(String value)
at System.Windows.Forms.Form.set_Text(String value)
I just had a chance to run your sample program and had the same results you did. No crashes at all.
I did notice that you did not change the caption of the form while closing (something we do) and modified your code and still did not have any exceptions. Everything worked perfectly.
Your attached video was identical to what my app running looked like.
Thanks for taking the time to make up this program so that I could try it. I was hoping to get the crash, but like you we rarely see the crash our customers get. So far we have one file that we can reproduce the issue with after six years of trying. Our customers get 5-6 crashes reported each day (out of thousands of customers).
Thanks for the reply. We are using Infragistics v14.2.20142.2010.
We found a solution for our crashes. If we change the ribbon IsGlassSupported to false all our crashes go away. Or if we have the PC with non-aero themes it goes away (not really a solution since we can't impose that on customer machines).
A typical call stack for this crash where you can see the Glass calls in the crash is:
Exception Count: 3
Exception Source: System.Drawing
Exception Type: System.ArgumentException
Exception Message: Parameter is not valid.
Exception Target Site: GetHdc
---- Stack Trace ----
System.Drawing.Graphics.GetHdc()
System.Drawing.dll : N 1623891
Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureTextGDIOrThemed(String text, Font font, TextFormatFlags textFormatFlags)
Infragistics4.Win.v13.1.DLL : N 00249
Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureCharacterRangesGDI(String text, Font font, TextFormatFlags textFormatFlags, CharacterRange[] ranges)
Infragistics4.Win.v13.1.DLL : N 00198
Infragistics.Win.FormattedLinkLabel.PositionElementsCache.ReMeasureParts(String text, Int32[] parts, Single[] widths, Int32 partStartIndex, Int32 partEndIndex, Font font, Single& lineHeight)
Infragistics4.Win.v13.1.DLL : N 00683
Infragistics.Win.FormattedLinkLabel.TextLayoutInfo.Measure(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00127
Infragistics.Win.FormattedLinkLabel.NodeText.PositionSelf(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00735
Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00073
Infragistics.Win.FormattedLinkLabel.NodeBase.PositionChildNodes(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00032
Infragistics.Win.FormattedLinkLabel.NodeBlock.PositionChildNodes(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 01110
Infragistics.Win.FormattedLinkLabel.NodeBase.CalcSize(IFormattedLinkLabelOwner owner, Graphics graphics, Int32 maxWidth)
Infragistics4.Win.v13.1.DLL : N 00252
Infragistics.Win.FormattedLinkLabel.ParsedFormattedTextValue.CalcSize(Graphics graphics, Font baseFont, AppearanceData& defaultAppearance, Int32 widthConstraint, DefaultableBoolean wrapText, GdiDrawStringFlags gdiDrawStringFlags)
Infragistics4.Win.v13.1.DLL : N 00794
Infragistics.Win.UltraWinToolbars.RibbonMetrics.CalculateCaptionAreaHeight()
Infragistics4.Win.UltraWinToolbars.v13.1.DLL : N 00971
Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.ExtendGlassIntoCaption(IntPtr handle)
Infragistics4.Win.UltraWinToolbars.v13.1.DLL : N 00139
Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.RefreshGlass()
Infragistics4.Win.UltraWinToolbars.v13.1.DLL : N 00375
System.EventHandler.Invoke(Object sender, EventArgs e)
mscorlib.dll : N 00000
We have only one file that can reproduce this issue, but we will release the IsGlassSupported change to our users and see if our crash logs show a reduction in big red X exceptions in the next few weeks. Our customers can live without glass support if they no longer crash. If this doesn't fix our problems I will post here again and try running your sample program.
Thank you for the update.
I created a small sample in order to test your scenario and I still can’t reproduce this issue. I am attaching the sample along with a video, which shows the behavior of the sample on my machine.
What version do you use? I tested it with the latest release of 14.2 and everything seems to work for me. Do you reproduce the exception with the attached sample? If you can’t, please modify the sample, so that the issue can be reproduced with it.
Thank you for your collaboration.
I am looking forward to hearing from you.
We have isolated this to happen for our users in at least one specific case.
When the user has the Infragistics ribbon, hits the ALT-key to activate the KeyTips and then closes the application by clicking the X in the upper right corner of the form. This will crash the ribbon every time for our application.
If the KeyTips are not active the application will close normally.
I am still following this thread. Have you been able to isolate this in a separate sample? Let me know if you menage to create one, I will be glad to further investigate it.
Thank you for using Infragistics Components.