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
The Bug still persists in Volume 10.3 Build 2041... but the Stacktrace seems to be a little bit different in my case... attached you can find the exception message and stacktrace.
The crash is still occures with WinForms 10.2. Infragistics are you going to fix this problem or not?!
I am seeing the same but although it appears to have to do with the UltraGrid control.This happens when the application is shut down. The only reason I know it's happening is because we've got an Unhandled exception system that records the exception and sends an email.... which it is currently doing every time a user shuts down the application.
This bug coincides with our upgrade from 10.1 to 10.2.
Here's the stack trace. I have recently upgraded from 10.1 to 10.2:
Normal 0 false false false EN-US X-NONE X-NONE
---- Stack Trace ----
System.Drawing.Graphics.GetHdc()
Caiso.Desktop.exe: N 1051317
System.Windows.Forms.Internal.WindowsGraphics.FromGraphics(g As Graphics, properties As ApplyGraphicsProperties)
Caiso.Desktop.exe: N 00232
System.Windows.Forms.WindowsGraphicsWrapper..ctor(idc As IDeviceContext, flags As TextFormatFlags)
Caiso.Desktop.exe: N 00147
System.Windows.Forms.TextRenderer.MeasureText(dc As IDeviceContext, text As String, font As Font, proposedSize As Size, flags As TextFormatFlags)
Caiso.Desktop.exe: N 00161
Infragistics.Win.DrawUtility.MeasureStringHelper(gr As Graphics, text As String, font As Font, layoutArea As Size, stringFormat As StringFormat, charactersFitted As Int32&, linesFilled As Int32&, returnElementsFitted As Boolean, drawStringFlags As GdiDrawStringFlags)
Caiso.Desktop.exe: N 00649
Infragistics.Win.DrawUtility.MeasureStringHorizontalFlowHelper(parameters As DrawStringParameters&, trackCharactersFitted As Boolean, charactersFitted As Int32&, linesFilled As Int32&, unrotatedLayoutArea As SizeF&, unrotatedTextSize As SizeF&)
Caiso.Desktop.exe: N 00539
Infragistics.Win.DrawUtility.MeasureStringHorizontalFlow(parameters As DrawStringParameters&, trackCharactersFitted As Boolean, charactersFitted As Int32&, linesFilled As Int32&, unrotatedLayoutArea As SizeF&, unrotatedTextSize As SizeF&)
Caiso.Desktop.exe: N 00197
Infragistics.Win.DrawUtility.MeasureStringHelper(parameters As DrawStringParameters&, trackCharactersFitted As Boolean, charactersFitted As Int32&, linesFilled As Int32&)
Caiso.Desktop.exe: N 00121
Infragistics.Win.DrawUtility.MeasureString(parameters As DrawStringParameters&)
Caiso.Desktop.exe: N 00028
Infragistics.Win.UltraWinGrid.UltraGridLayout.MeasureStringF(gr As Graphics, text As String, font As Font, maxWidth As Int32, sf As StringFormat, textOrientation As TextOrientationInfo)
Caiso.Desktop.exe: N 00206
Infragistics.Win.UltraWinGrid.UltraGridLayout.MeasureString(gr As Graphics, text As String, font As Font, maxWidth As Int32, sf As StringFormat, textOrientation As TextOrientationInfo)
Caiso.Desktop.exe: N 00034
Infragistics.Win.UltraWinGrid.UltraGridLayout.CalculateFontSize(font As Font, text As String, maxWidth As Int32, textOrientation As TextOrientationInfo)
Caiso.Desktop.exe: N 00191
Infragistics.Win.UltraWinGrid.UltraGridLayout.CalculateFontHeight(font As Font)
Caiso.Desktop.exe: N 00027
Infragistics.Win.UltraWinGrid.UltraGridLayout.CalculateFontHeight(appData As AppearanceData&)
Caiso.Desktop.exe: N 00076
Infragistics.Win.UltraWinGrid.UltraGridLayout.get_DefaultFontHeight()
Caiso.Desktop.exe: N 00120
Infragistics.Win.UltraWinGrid.UltraGridBand.CalcMinRowHeight()
Caiso.Desktop.exe: N 00253
Infragistics.Win.UltraWinGrid.UltraGridBand.GetMinRowHeightHelper(synchronized As Boolean)
Caiso.Desktop.exe: N 00044
Infragistics.Win.UltraWinGrid.UltraGridBand.get_RowHeightResolved()
Caiso.Desktop.exe: N 00091
Infragistics.Win.UltraWinGrid.RowScrollRegion.ResetScrollInfo()
Caiso.Desktop.exe: N 00160
Infragistics.Win.UltraWinGrid.ScrollRegionBase.ShowScrollbar(show As Boolean, resetScrollInfo As Boolean)
Caiso.Desktop.exe: N 00061
Infragistics.Win.UltraWinGrid.RowScrollRegion.PositionScrollbar(resetScrollInfo As Boolean)
Caiso.Desktop.exe: N 00241
Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(resetScrollInfo As Boolean)
Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(assumeColScrollbarsVisible As ScrollbarVisibility)
Caiso.Desktop.exe: N 00177
Infragistics.Win.UltraWinGrid.ScrollRegionBase.WillScrollbarBeShown()
Caiso.Desktop.exe: N 00012
Infragistics.Win.UltraWinGrid.ViewStyleBase.AddBandHeaders(csr As ColScrollRegion, band As UltraGridBand)
Caiso.Desktop.exe: N 00176
Infragistics.Win.UltraWinGrid.ViewStyleSingle.RecreateHeaderList(csr As ColScrollRegion)
Caiso.Desktop.exe: N 00167
Infragistics.Win.UltraWinGrid.ColScrollRegion.RegenerateVisibleHeaders()
Caiso.Desktop.exe: N 00165
Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetricsHelper()
Caiso.Desktop.exe: N 00148
Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetrics()
Caiso.Desktop.exe: N 00041
Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(newDataSource As Object, newDataMember As String)
Caiso.Desktop.exe: N 00683
Infragistics.Win.UltraWinGrid.UltraGridBase.set_DataSource(value As Object)
Caiso.Desktop.exe: N 00414
Infragistics.Win.UltraWinGrid.UltraGridBase.DataSource_Disposed(sender As Object, e As EventArgs)
Caiso.Desktop.exe: N 00014
System.ComponentModel.Component.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00221
System.Windows.Forms.BindingSource.Dispose(disposing As Boolean)
System.ComponentModel.Component.Dispose()
Caiso.Desktop.exe: N 00017
System.ComponentModel.Container.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00145
System.ComponentModel.Container.Dispose()
Caiso.OutageManagement.Oms.Transmission.View.Controls.ctlRecordList.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00054
System.Windows.Forms.Control.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00408
Infragistics.Win.IGPanel.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00151
Infragistics.Win.UltraWinTabControl.UltraTabPageControl.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00010
Infragistics.Win.UltraControlBase.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00164
Infragistics.Win.UltraWinTabControl.UltraTabControlBase.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00909
Infragistics.Win.UltraWinTabControl.UltraTabControl.Dispose(disposing As Boolean)
System.Windows.Forms.ContainerControl.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00030
Caiso.OutageManagement.Oms.Transmission.View.Controls.ctlBrowseData.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00053
System.Windows.Forms.Form.Dispose(disposing As Boolean)
Caiso.Desktop.exe: N 00626
Caiso.FormControls.FormBase.Dispose(disposing As Boolean)
Caiso.OutageManagement.Oms.Transmission.OutageDetail.BrowseDataForm.Dispose(disposing As Boolean)
Caiso.Desktop.DesktopView.Dispose(disposing As Boolean)
System.Windows.Forms.Form.WmClose(m As Message&)
Caiso.Desktop.exe: N 00568
System.Windows.Forms.Form.WndProc(m As Message&)
Caiso.Desktop.exe: N 00449
System.Windows.Forms.ControlNativeWindow.OnMessage(m As Message&)
Caiso.Desktop.exe: N 00015
System.Windows.Forms.ControlNativeWindow.WndProc(m As Message&)
Caiso.Desktop.exe: N 00048
System.Windows.Forms.NativeWindow.Callback(hWnd As IntPtr, msg As Int32, wparam As IntPtr, lparam As IntPtr)
Caiso.Desktop.exe: N 00089
Going by that call stack, this looks very much like a bug that was fixed last year (bug ID 20297), but that was fixed before the 10.1 release, so I am at a loss to explain how you are getting this in any version of 10.1. You should probably log an incident for this.