C1SplitButton: Crash if UIAutomation is enabled

Posted by: wknauf on 6 September 2024, 9:21 am EST

  • Posted 6 September 2024, 9:21 am EST

    Hi C1,

    C1SplitButton crashes if a UIAutomation provider is enabled (e.g. caused by windows screen narrator, might also happen in RDP/Citrix sessions):

    Exception-Type: System.InvalidCastException
    
    Message: Unable to cast object of type 'C1.Win.Input.SplitButtonItem' to type 'C1.Win.Input.C1SplitButton'.
    
    StackTrace:
       at i.a()
       at i..ctor(bd a, dm b)
       at bd.bc()
       at fv.get_b()
       at cm..ctor(dm a, C1SplitButton b)
       at dm.ck()
       at fw.get_b()
       at fw.WndProc(Message& a)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

    Attached sample reproduces it:

    step 1: start windows screen narrator

    step 2: start the sample, drop down the split button and hover over the items. I have a global “unhandled exception” handler which shows a messagebox.

    SplitButtonTest.zip

    Some time ago, a similar problem happened with C1FlexGrid: https://developer.mescius.com/forums/winforms-edition/c1flexgrid-crash-raiseautomationevent-value-cannot-be-null

    But I cannot apply the workaround to override WndProc and ignore event “61”. My sample already contains a C1SplitButton subclass, but the issue still happens. Do you have any idea?

    Best regards

    Wolfgang

  • Posted 7 September 2024, 12:06 pm EST

    It happens only when hovering over items that have child items.

    Workaround to avoid the crash: override “WndProc” in e.g. the form that contains the C1SplitButton. If the message “WM_GETOBJECT” is received, then hide all drop down items that contain child items. Of course this means that part of the functionality is lost.

    protected override void WndProc(ref Message m)
    {
      //WM_GETOBJECT = 61 = 0x003D
      if (m.Msg == 61)
      {
        //...Hide all items with children
      }
    }
    

    Hopefully, C1 has an idea for a better workaround.

  • Posted 9 September 2024, 5:19 am EST

    Hello Wolfgang,

    Thank you for providing the details. We were able to observe the behavior as well.

    We have escalated it to the development team for their insights. Rest assured, we’ll update once we have more information.

    [Internal tracking ID: C1WIN-32912]

    Regards,

    Uttkarsh.

  • Posted 23 September 2024, 7:52 am EST

    Hello Wolfgang,

    As per the development team, the reported behavior is a bug.

    [Bug tracking ID: C1WIN-32976]

    Unfortunately, currently we neither have a workaround for this nor an ETA for the fix. Rest assured, we’ll update you once the issue’s fixed.

    Regards,

    Uttkarsh.

  • Posted 28 October 2024, 7:57 am EST

    Just asking for an update: Is there a schedule for the fix?

    Best regards

    Wolfgang

  • Posted 29 October 2024, 7:41 am EST

    Hello Wolfgang,

    We’re getting in touch with the team to get an update on the schedule for the fix? We’ll get back to you once we have more information.

    Regards,

    Uttkarsh.

  • Posted 8 November 2024, 5:19 am EST

    Hello Wolfgang,

    As per the team, since this issue was reported between July and November, it will be fixed after the 2024v2 release, on the following Hotfixes.

    Regards,

    Uttkarsh.

Need extra support?

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

Learn More

Forum Channels