I am trying to get DoMessageLoopWork() to work, but currently it's crashing the sample application CefGlue.Samples.WpfOsr on my website http://killtube.org, while http://google.com e.g. works (often, sometimes crashing also with System.InvalidOperationException).
The real crash looks like this:
In Program.cs:
- Code: Select all
var cefSettings = new CefSettings
{
// BrowserSubprocessPath = browserSubprocessPath,
SingleProcess = true,
WindowlessRenderingEnabled = true,
MultiThreadedMessageLoop = false,
LogSeverity = CefLogSeverity.Verbose,
LogFile = "cef.log",
};
Then I added the DoMessageLoopWork() in MainWindow.xaml.cs:
- Code: Select all
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.MouseMove += MainWindow_MouseMove;
}
int i = 5;
void MainWindow_MouseMove(object sender, MouseEventArgs e)
{
if (i == 0)
{
CefRuntime.DoMessageLoopWork();
i = 5;
}
i--;
}
protected override void OnClosed(EventArgs e)
{
browser.Dispose();
base.OnClosed(e);
}
private void addressTextBox_KeyDown_1(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
browser.NavigateTo(addressTextBox.Text);
}
}
}
I call DoMessageLoopWork() in every 5th mouse move event. When I call it too often, it throws "System.InvalidOperationException".
Does somebody know how to fix this?
Kind regards,
kungfooman