Jump to content
jesu

TEdgeBrowser creation randomly fails

Recommended Posts

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
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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×