jesu 3 Posted yesterday at 11:16 AM Hello. I have an application in which I show some webpages and pdfs, so I'm using tedgebrowser. I have copied WebView2Loader.dll. In the same computer, some days it works, other days it doesn't work. I have a declaration: WebBrowser: TEdgeBrowser; First of all I do is to initialize it: WebBrowser.CreateWebView; and I have a procedure to know when it fails: procedure TFPrincipal.WebBrowserCreateWebViewCompleted(Sender: TCustomEdgeBrowser; AResult: HRESULT); begin // el problema de esto es que se llama de forma asíncrona y tarda un buen rato if Succeeded(AResult) then begin // ProcDebug('finalizó creación edge'); if WebBrowser.ControllerInterface <> nil then WebBrowser.ControllerInterface.Set_IsVisible(Integer(LongBool(True))); end else begin ShowMessage('>> Fallo en creación navegador hresult: ' + IntToStr(Aresult)); end; end; when it fails it returns hresult: -2147023496. I've tried to find the meaning and I arrived here: https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/winrt/microsoft_web_webview2_core/corewebview2weberrorstatus?view=webview2-winrt-1.0.2903.40 but I can't identify the issue. How can I know where's the problem? Thanks. Share this post Link to post
FPiette 392 Posted yesterday at 11:55 AM 36 minutes ago, jesu said: -2147023496 You must convert this code to hexadecimal => 80070578 Then search Google for this code and edge browser. The code 80070578 means: "invalid window handle". Share this post Link to post
jesu 3 Posted 23 hours ago 24 minutes ago, FPiette said: Then search Google for this code and edge browser. The code 80070578 means: "invalid window handle". Thanks. The search only returns this page: https://github.com/MicrosoftEdge/WebView2Feedback/issues/3097 where they talk about random issues that are solved restarting the computer. Is there any other way I could/should try to restart the webview? Share this post Link to post
FPiette 392 Posted 20 hours ago 3 hours ago, jesu said: Is there any other way I could/should try to restart the webview? I don't know. I have written only one application which make use TEdgeBrowser. It's part of an automation process which runs every single day without any glitch. In that application, TEdgeBrowser is simply dropped on the VCL form. I don't even use OnCreateWebViewCompleted event. Share this post Link to post
salvadordf 37 Posted 5 hours ago (edited) Try using WebView4Delphi and implement the TWVBrowser.OnInitializationError and GlobalWebView2Loader.OnInitializationError events. Check the GlobalWebView2Loader.ErrorMessage and GlobalWebView2Loader.ErrorCode values too. Keep the browser visible until it's fully initialized and then hide it. Edited 4 hours ago by salvadordf Share this post Link to post