Welcome Guest Search | Active Topics | Sign In | Register

EO.Browser error stop engine with ctlr-1 Options
TELUS Buyers
Posted: Tuesday, December 1, 2020 4:44:20 PM
Rank: Member
Groups: Member

Joined: 5/9/2017
Posts: 14
If the focus is in the eobrowser control and you do ctrl+1, the app will crash. if the focus is outside, all is ok.

ctrl+1 was selected, but all the combinations i tried don't work
see
MyCommand.InputGestures.Add(new KeyGesture(Key.D1, ModifierKeys.Control));
for selecting another shortcut

Error is the following:

System.Exception: 'Failed to stop engine 'Default''

Sent a project to test it out via the contact us form.
eo_support
Posted: Wednesday, December 2, 2020 4:12:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

We have looked into your test project. Please try to wrap your code into Dispatcher.BeginInvoke:

Code: C#
private void MyCommandExecuted(object sender, ExecutedRoutedEventArgs e)
{
    this.Dispatcher.BeginInvoke((System.Action)(() =>
    {
        EO.WebEngine.Engine.Default.Stop(false);
        EO.WebEngine.Engine.Default.Start();
    }));
}


This is necessary because you can't try to stop the Engine when the Engine is in the process of trying to call you back (this is like trying to take out the ladder you are currently standing on). So you have to return from your event handler first, then call Stop at a later time, which can be easily achieved by using Dispatcher.BeginInvoke.

Thanks!
TELUS Buyers
Posted: Wednesday, December 9, 2020 9:06:54 AM
Rank: Member
Groups: Member

Joined: 5/9/2017
Posts: 14
It worked perfectly! Thanks for your help!
eo_support
Posted: Wednesday, December 9, 2020 10:53:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Great. Glad that it worked for you!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.