Strange unhandled exceptions

Posted by: silk on 8 September 2017, 12:30 pm EST

  • Posted 8 September 2017, 12:30 pm EST

    Hello,


    We have been experiencing some strange behaviour from some of our forms which contain spreads. At some points our application is just shutting down without giving any visible exceptions what so ever. No normal error handling with try-catch seemed to catch any exceptions. Then last week we implemented an unhandled exception handler to see if there were any exceptions that couldn't be caught by the "normal" exception handlers. This has so far given us a little bit more info about what is causing the strange behaviour. Below are two errors in all its grace which tells us that it is indeed the spread that is causing the errors but the messages themselves doesn't help us that much.


     

    System.ArgumentException: Item has already been added.  Key in dictionary: "-8"  Key being added: "-8"
    at FarPoint.Win.Spread.FpSpread.WndProc(Message& m)
    at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
      
    System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at FarPoint.Win.Spread.FpSpread.WndProc(Message& m)
    at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Anyone got any bright ideas of what's behind this or how we can get more information about the exceptions?


    The application has no bound data to it and almost all text and formatting is set at runtime since it need to be very dynamic. One thing some users have been experiencing is that when they right click in a cell they are supposed to get a context menu (with some basic items to trigger other forms etc) but in fact the menu that get's shown is the built in context menu from the spread (even though we have disabled this that). Right after this the entire application crashes.


    Please note that this error occur at very rare occasions and have no red line which we can follow.


    /Johan

  • Replied 8 September 2017, 12:30 pm EST

    Johan,


    I am not finding any information about either of these issues you have mentioned. Since this is only happening randomly, are you implementing multiple threads in your application. If you are, you need to make sure you are using delegates to call the functions on the seperate thread. Else, you could get weird issues like you are seeing.

  • Replied 8 September 2017, 12:30 pm EST

    Hello Scotts,


    No, we are not implementing our own multiple threads in this application. It is an MDI child though but it doesn't interact with any of the other forms when these error occur.

  • Replied 8 September 2017, 12:30 pm EST

    Johan,


    What kinds of things are happening in your application (especially with the spreadsheet) when this exception occurs. Could you post a small zipped project reproducing this issue for us to debug?

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels