RadAutoCompleteBox Dispatch Processor VSTO

1 Answer 23 Views
AutoCompleteBox HighlightTextBlock
Alan
Top achievements
Rank 1
Iron
Iron
Iron
Alan asked on 24 Jan 2024, 07:17 AM

See the following:

Dispatcher process has been suspended, but messages are still being processed. in UI for WPF | Telerik Forums

I cannot reproduce using a simple test project. I am attaching a Word VSTO project that is a test version. I have removed packages which included Fody PropertyChanged and the Telerik Xaml controls.

We are seeing a Dispatch Processor error in Word when the HighlightText is enabled. It goes away if that is removed. Our VSTO project is way too large to easily demo but we passed QA if that HighlightText is removed. Why that is happening is hard to say since Word COM provides little to no information on the issue.

I will compare code against Vladimir's sample and see if I can spot differences. Will get back if something pops out.

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 24 Jan 2024, 01:35 PM

Hello Alan,

Thank you for the shared project.

I was able to observe the described error on my end after changing the default values for the Name of the Template objects like so:

private void LoadData()
{
    for (int i = 0; i < 1000; i++)
    {
        AllTemplates.Add(new Template() { Name = "Name " + i });
    }
}

followed by quickly typing and deleting characters in the RadAutoSuggestBox.

I was also able to observe more info about the exception by adding a UnhandledExceptionFilter event handler like so:

  public partial class Ribbon1
  {
      private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
      {
	Dispatcher.CurrentDispatcher.UnhandledExceptionFilter +=
        new DispatcherUnhandledExceptionFilterEventHandler(Dispatcher_UnhandledExceptionFilter);
       }

      private void Dispatcher_UnhandledExceptionFilter(object sender, DispatcherUnhandledExceptionFilterEventArgs e)
      {
	e.RequestCatch = false;
      }
  }

I checked out the callstack for the exception, however there weren't any Telerik classes included in it. I am attaching the callstack inside a txt file for your reference. With this in mind, I am afraid that we cannot log this in our feedback portal as there isn't anything concrete to update in our source code. 

That said, after including the above mentioned code the program continued executing even after the exception was thrown. I also tested the following approach of dispatching the ShowDialog call (without the event handler for UnhandledExceptionFilter) and with this change I was not able to reproduce the error:

private void btnTestAutoComplete_Click(object sender, RibbonControlEventArgs e)
{
    var wpfHost = new WpfHost();
    var wpfControl = new DemoUserControl();

    wpfHost.MainElementHost.Child = wpfControl;

    Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() =>
    {
        wpfHost.ShowDialog();
    }));
}

Can you give this approach a try and let me know, if it helps in your scenario?

Regards,
Vladimir Stoyanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Alan
Top achievements
Rank 1
Iron
Iron
Iron
commented on 31 Jan 2024, 06:05 AM

Vladimir,

Thanks for the help. I wanted to wait a bit to see how this fared with our QA person. It worked with no issues.

 

 

Tags
AutoCompleteBox HighlightTextBlock
Asked by
Alan
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or