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 Atelford4tell,
Thank you for your feedback.
If you are experiencing the same behavior after applying to latest service release, I would like you to let me know what is the exact version of the GDI installed on your machine, and also if possible a small sample reproducing this behavior.
I will be glad to assist you further towards resolving the issue that you are currently having.
I tried the suggestion from guther but unfortunately it did not work for me. It did send me on a path to play around with this particular machines video settings. I did successfully make it work by selecting a non Aero theme for the machine. When I switch the machine back to Aero I get the error, switch the theme again and the error is gone. Thank you for the direction guther
I will try the latest service release as suggested by Danko but it will be a while before we can do that as we recently finished the latest upgrade and all of the costly regression testing that goes with it and we can't take on that cost again for a while.
Hello atelford4tell,
I have tried to reproduce this exception using the latest service release for 11 vol1 - 2071, and the application worked correctly.
Could you please download this service release from your "My IG" , "My Keys and Downloads", applied it to your machine after that, and verify the behavior of your application against it.
If the exception still occurs, could you please let me know what is the current version of your GDI file, and if possible provide me with a small sample that I would be able to test at my end.
Please feel free to ask if you have any other questions with this matter.
After much teeth-gnashing I found somewhere (can't remember where) that setting the IsGlassSupported property on the UltraToolbarsManager to False solved the problem. It certainly worked for me - doesn't seem to affect the appearance of the toolbars and I've not had the error since.
I am also getting this same error but it only happens on one machine in our office. It works perfectly fine on many other desktops. This is really a problem because this application is used heavily by this user and I am concerned that more of our users will start to experience this.
Client OS: 32 bit Windows 7 Ultimate SP1
Version: 11.1.20111.2030
Stack Trace
ExceptionType: ArgumentException
HelpLink:
Message: Parameter is not valid.
Source: System.Drawing
StackTrace 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.ButtonTool.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.RefreshDockAreaSize(Size& currentSize)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.RefreshDockAreaSize()
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.OnFormLoad(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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)
TargetSite: IntPtr GetHdc()