Exception in C1InputPanel

Posted by: mike on 6 February 2020, 1:13 am EST

  • Posted 6 February 2020, 1:13 am EST

    … trying to figure out the problem. Note: the application is multithreaded. Once in a while this exception happens:

    System.InvalidOperationException: Object is currently in use elsewhere.

    Trace:

    at System.Drawing.Image.get_RawFormat()

    at System.Drawing.Graphics.DrawImage(Image image, Rectangle destRect, Int32 srcX, Int32 srcY, Int32 srcWidth, Int32 srcHeight, GraphicsUnit srcUnit, ImageAttributes imageAttrs, DrawImageAbort callback, IntPtr callbackData)

    at C1.Win.C1InputPanel.InputUtil.ExtractImageH(Image batchImage, Int32 index, Int32 count)

    at C1.Win.C1InputPanel.InputTheme…ctor(VisualStyle visualStyle)

    at C1.Win.C1InputPanel.InputTheme.GetTheme(VisualStyle visualStyle)

    at C1.Win.C1InputPanel.XInputPanel.get_ThemeStyleSet()

    at C1.Win.C1InputPanel.XInputPanel.ApplyTheme()

    at C1.Win.C1InputPanel.C1InputPanel.ReapplyTheme()

    at C1.Win.C1InputPanel.XInputPanel.set_VisualStyle(VisualStyle value)

    at C1.Win.C1InputPanel.C1InputPanel.OnAmbientChangedVisualStyle()

    Can you help point us in the right direction for seeing how to fix this?

  • Posted 6 February 2020, 3:56 pm EST

    Hi,

    It’s very difficult to find the cause of this from the exception alone. We can only infer that you are having issues in synchronizing access to a resource.

    If you can replicate this in a small sample and show us, we would be able to help you more appropriately.

    A more general suggestion would be to make use of BeginInvoke (https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.begininvoke?view=netframework-4.8). However, this would depend on where and when you’re getting this exception.

    Regards,

    Jitender

Need extra support?

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

Learn More

Forum Channels