Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
762
Intermittent System.ArgumentException: Parameter is not valid on UltraPictureBox
posted

We have a .Net 3.5 WinForms app using a UltraWinEditors.v7.3 UltraPictureBox, and it is crashing intermittently with:

System.ArgumentException: Parameter is not valid.
   at System.Drawing.Image.get_Width()
   at System.Drawing.Image.get_Size()
   at Infragistics.Win.EmbeddableImageRendererUIElement.PositionChildElements()
   at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
   at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
   at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive)
   at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered)
   at Infragistics.Win.ControlUIElementBase.get_CurrentCursor()
   at Infragistics.Win.UltraControlBase.get_Cursor()
   at System.Windows.Forms.Control.WmSetCursor(Message& m)
   at System.Windows.Forms.Control.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)

This is a JIT error; it is not being caught by the catch clause in Main or Windows.Forms.Application.ThreadException handler.

The error is very intermittent; we can be using the pictureBox for hours, then suddenly the app shuts down with an "Unhandled exception ... in your application" dialog. It is triggered by something we are doing; if no one touches the app it never crashes, but there is no way to reliably cause the crash.

Parents
  • 37774
    Verified Answer
    posted

    It sounds like your application is using multi-threading, which seems especially evident as the problem doesn't manifest itself except for intermmitent issues.  From the call stack that you posted, it seems that the Callback method further shows that there's something that you're doing that's updating the UltraPictureBox on another thread; you should ensure that any calls that you have that might update the UI thread are properly marshalled back to the UI thread.  As a general .NET practice, you should not be updating any controls outside of the UI thread.

    -Matt

Reply Children