Divide by Zero (and it's not me)

3 posts, 0 answers
  1. Chris Kirkman
    Chris Kirkman avatar
    101 posts
    Member since:
    Apr 2010

    Posted 18 Jan Link to this post

    We're getting a Divide by Zero exception from one of the Telerik components.  We can't track it down.

    We create an instance of a COM component which is an old COM dll.  Any time we try to open a form with Telerik controls on it the application crashes with a StackOverflow exception.  I've attached the stack.  This is a really high priority item for us at this point and holding up our release.  :(

    Additionally, we can create an instance of the COM component in a test application without any problems whatsoever.

     

    ************** Exception Text **************
    System.DivideByZeroException: Attempted to divide by zero.
       at Telerik.WinControls.UI.RadCommandBarItemsPanel.ArrangeOverride(SizeF arrangeSize)
       at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
       at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
       at Telerik.WinControls.UI.CommandBarStripElement.ArrangeOverride(SizeF finalSize)
       at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
       at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
       at Telerik.WinControls.UI.CommandBarRowElement.ArrangeOverride(SizeF finalSize)
       at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
       at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
       at Telerik.WinControls.Layouts.StackLayoutPanel.ArrangeOverride(SizeF arrangeSize)
       at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
       at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
       at Telerik.WinControls.UI.LightVisualElement.ArrangeOverride(SizeF finalSize)
       at Telerik.WinControls.UI.RadCommandBarElement.ArrangeOverride(SizeF finalSize)
       at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
       at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
       at Telerik.WinControls.RootRadElement.ArrangeOverride(SizeF finalSize)
       at Telerik.WinControls.RootRadElement.ArrangeCore(RectangleF finalRect)
       at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
       at Telerik.WinControls.RadElementTree.PerformInnerLayout(Boolean performMeasure, Int32 x, Int32 y, Int32 width, Int32 height)
       at Telerik.WinControls.RadControl.OnLoad(Size desiredSize)
       at Telerik.WinControls.UI.RadCommandBar.OnLoad(Size desiredSize)
       at Telerik.WinControls.RadControl.LoadElementTree(Size desiredSize)
       at Telerik.WinControls.RadControl.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       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 Telerik.WinControls.UI.RadFormControlBase.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 

     

     

  2. Chris Kirkman
    Chris Kirkman avatar
    101 posts
    Member since:
    Apr 2010

    Posted 18 Jan Link to this post

    Looks like I may have finally resolved it.  The COM component when loaded on the same thread as my app just plain failed.  When I started it in it's own background thread, that equally failed.  We found that starting it on it's own thread and then setting its state to STA did the trick.
  3. Hristo
    Admin
    Hristo avatar
    1507 posts

    Posted 21 Jan Link to this post

    Hi Chris,

    Errors in the layout can be caused by multithreading in the UI thread. The following MSDN resource discusses multithreading in WinForms: https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/multithreading-in-windows-forms-controls. The call stack suggests that the error is being raised while executing the layout. This logic is at a very base level and an error there can mean that the application is an invalid state. 

    We are not aware of an issue when mixing the controls with COM components. As I understand you have managed to resolve the issue. In case you would like us to test a sample application with the COM dll, please send it over. For that purpose, you can use the ticketing system which is a private channel for communication.

    Let me know if you need further assistance.

    Regards,
    Hristo
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top