Welcome Guest Search | Active Topics | Sign In | Register

WPF application crashed when hosting WPF EO browser in Windows form using Elementhost. Options
bnymellon
Posted: Saturday, September 19, 2020 3:21:42 AM
Rank: Advanced Member
Groups: Member

Joined: 3/10/2020
Posts: 59
Hi,
We are using WPF EO.WebBrowser in Winforms using ElementHost(System.Windows.Forms.Integration).
WPF application is crashed when user clicks in text box and try to input values in a webpage.
Same is working fine when webview hosted in WPF window.

Below is the event viewer stack trace.

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Forms.Integration.ApplicationInterop.ThreadMessageFilter(System.Windows.Interop.MSG ByRef, Boolean ByRef)
at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(System.Windows.Interop.MSG ByRef)
at EO.Wpf.WebViewHost+a.c(c)
at EO.Wpf.WebViewHost+a.a(c)
at EO.WebBrowser.WebView+i.a(UInt32, IntPtr, IntPtr, Boolean ByRef)
at EO.WebBrowser.WebView+l.a(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at EO.Internal.x.b(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at EO.Internal.x.b(IntPtr, Int32, IntPtr, IntPtr)

Please advice on above exception

Does EO browser support winforms elementhost ?

ElementHost:
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.integration.elementhost?view=netcore-3.1.
https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/walkthrough-hosting-a-wpf-composite-control-in-windows-forms?view=netframeworkdesktop-4.8



eo_support
Posted: Saturday, September 19, 2020 1:45:54 PM
Rank: Administration
Groups: Administration

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

You should not use it this way. EO.WebBrowser has a Windows.Form wrapper control (EO.WinForm.WebControl) that you can use directly inside a Windows.Form application. So there is no need for you to use the WPF version and then use an ElementHost in order to put it inside a Windows.Forms application.

Thanks!


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.