Our application uses 10.1.20101.2013 build of WinForms. Our customers reporting, the same crash, that originates from UltraWinToolbars. The crash occurs randomly but on a regular basis. Below is the stack trace:
************** Exception Text **************System.ArgumentException: Parameter is not valid. at System.Drawing.Graphics.GetHdc() at System.Windows.Forms.Internal.WindowsGraphics.FromGraphics(Graphics g, ApplyGraphicsProperties properties) at System.Windows.Forms.WindowsGraphicsWrapper..ctor(IDeviceContext idc, TextFormatFlags flags) at System.Windows.Forms.TextRenderer.MeasureText(IDeviceContext dc, String text, Font font, Size proposedSize, TextFormatFlags flags) at Infragistics.Win.DrawUtility.MeasureStringHelper(Graphics gr, String text, Font font, Size layoutArea, StringFormat stringFormat, Int32& charactersFitted, Int32& linesFilled, Boolean returnElementsFitted, GdiDrawStringFlags drawStringFlags) at Infragistics.Win.DrawUtility.MeasureString(Graphics gr, String text, Font font, Int32 width, StringFormat stringFormat, GdiDrawStringFlags drawStringFlags) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.MeasureString(AppearanceData& appearance, Font font, String stringToMeasure, Boolean isVertical, HotkeyPrefix hotkeyPrefix, ToolBase tool) at Infragistics.Win.UltraWinToolbars.ToolBase.MeasureString(AppearanceData& appearance, Font font, String stringToMeasure) at Infragistics.Win.UltraWinToolbars.ToolBase.GetTextSize() at Infragistics.Win.UltraWinToolbars.ButtonTool.CalculateLogicalSizeOfToolInstanceHelper(ToolBase tool) at Infragistics.Win.UltraWinToolbars.PopupToolBase.CalculateLogicalSizeOfToolInstance() at Infragistics.Win.UltraWinToolbars.ToolBase.CalculateLogicalSizeOfToolInstanceHelper() at Infragistics.Win.UltraWinToolbars.ToolBase.CalculateWidthResolved(Boolean useCalculateLogicalSize) at Infragistics.Win.UltraWinToolbars.ToolBase.get_WidthResolved() at Infragistics.Win.UltraWinToolbars.UltraToolbarBase.AdjustToolWidths(Int32 extent) at Infragistics.Win.UltraWinToolbars.DockRow.GetToolbarLogicalPositions(Int32 extent, Int32[]& widths) at Infragistics.Win.UltraWinToolbars.DockRow.CalculateMetrics() at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.AddToolbar(UltraToolbarBase toolbar, Int32 row, Int32 col, Boolean refreshDockAreaSize, Boolean exclusiveOnRow) at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.AddToolbar(UltraToolbar toolbar, Boolean restoreOldPosition) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.AddToolbarToDockArea(UltraToolbar toolbar, Boolean restoreOldPosition) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.AddToolbarsToDockArea(List`1 toolbarList) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.AddToolbarsToDockArea(DockedPosition targetDockArea) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.InitializeDockAreaToolbars() at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.InternalSetActiveMdiChildManager(UltraToolbarsManager newActiveMdiChildManager, Boolean calledFromMdiChildActivate, Boolean remergeIfUnchanged) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.OnFormMdiChildActivated(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnMdiChildActivate(EventArgs e) at System.Windows.Forms.Form.ActivateMdiChildInternal(Form form) at System.Windows.Forms.Form.WmMdiActivate(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at ?.?.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)
Is this a known bug, is there a hotfix?
Thanks
Hello,
We still have the problem with version 14.1.20141.2059When the exception occurs a big red cross appears in the UltraWinToolbar and the application stops working.The weird thing about this is that only 1-2 customers gets this type of error and 200 others users don't.The users are working on windows 7 machines.
System.ArgumentException: Ongeldige parameter.
bij System.Drawing.Graphics.GetHdc()
bij Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureTextGDIOrThemed(String text, Font font, TextFormatFlags textFormatFlags)
bij Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureCharacterRangesGDI(String text, Font font, TextFormatFlags textFormatFlags, CharacterRange[] ranges)
bij Infragistics.Win.FormattedLinkLabel.PositionElementsCache.ReMeasureParts(String text, Int32[] parts, Single[] widths, Int32 partStartIndex, Int32 partEndIndex, Font font, Single& lineHeight)
bij Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureParts(String text, Int32[] parts, Font font, Single& lineHeight)
bij Infragistics.Win.FormattedLinkLabel.NodeText.TextLayoutInfo.Measure(PositionElementsInfo& info)
bij Infragistics.Win.FormattedLinkLabel.NodeText.PositionSelf(PositionElementsInfo& info)
bij Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)
bij Infragistics.Win.FormattedLinkLabel.NodeBase.Position(PositionElementsInfo& info)
bij Infragistics.Win.FormattedLinkLabel.NodeBase.PositionChildNodes(PositionElementsInfo& info)
bij Infragistics.Win.FormattedLinkLabel.NodeBlock.PositionChildNodes(PositionElementsInfo& info)
bij Infragistics.Win.FormattedLinkLabel.NodeBase.PositionElements(IFormattedLinkLabelOwner owner, UIElement containerElem, Rectangle containerRect, Boolean calcIdealLayoutSize, Size& layoutSize)
bij Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionElementsHelper(Rectangle layoutRect, Boolean setElemRectToIdealSize)
bij Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionChildElements()
bij Infragistics.Win.UltraWinToolbars.RibbonCaptionUIElement.PositionChildElements()
bij Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
bij Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics)
bij Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics)
bij Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)
bij Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe)
bij Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnPaint(PaintEventArgs pe)
bij System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
bij System.Windows.Forms.Control.WmPaint(Message& m)
bij System.Windows.Forms.Control.WndProc(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Does anyone have an idea where this exception is coming from and how to fix it?
Thanks in advantage.
Hello Bin,
After investigating in details your case I believe there are two possible reasons for this exception:
1. You may set too many images for appearances objects for tools. In some moment your application is very close to reaches memory limit for your application and the next image object cannot be created. Then you try use it and application throws an exception. You may find more information how to avoid such kind of issues following this link http://help.infragistics.com/Doc/WinForms/current/CLR4.0/?page=WinGrid_Formatting_and_Appearance_based_Performance_Improvement.html
2. On second hand your application may try to reference an image already disposed. This occurs if you create some image, then dispose it and the try to refer it.
Without sample which reproduces this issue those are the only possible reasons which I could make a guesses, if you can send me an example code throwing this exception I will be glad to investigate this in more details for your.
Please check these two possible reasons for the exception and let me know if this solve your issue or if I am missing something.
Hello Danko,
I also encountered the same exception on Win7 and Win8 several times in the last year randomly (version 10.3.201032067).
They all originated from Infragistics.Win.DrawCache.Finalize() as shown in the stack trace bellow :
Method : TransformPointsType : System.Drawing.GraphicsAssembly : System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3aAssembly Path : C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dllSource : System.DrawingThread : 2 ''Helplink : Message:"Parameter is not valid."Properties: ArgumentException.ParamName = ""Stack Trace: at System.Drawing.Graphics.TransformPoints(CoordinateSpace destSpace, CoordinateSpace srcSpace, Point[] pts) at Infragistics.Win.DrawCache.FlushNativeCachedGraphics() at Infragistics.Win.DrawCache.FlushCachedGraphics() at Infragistics.Win.DrawCache.FreeState() at Infragistics.Win.DrawCache.Finalize()Is this issue known to you and is there a hotfix ?
Hello Derek,
What you could try is upgrading your application to the latest service release available for you version which is 11.1.20111.2111 and verify if there the behavior is fixed.If you have any other questions please feel free to ask.
I also am having the same issue on v11.1.20111.2009. Is there any status on this issue?