salvadordf / WebView4Delphi

WebView4Delphi is an open source project created by Salvador Díaz Fau to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows.
https://www.briskbard.com/forum/
MIT License
282 stars 59 forks source link

Got stuck after CreateBrowser: No invoke of ControllerCompleted #35

Closed skubidu1324 closed 1 year ago

skubidu1324 commented 1 year ago

On initialization of my DLL create the GlobalWebView2Loader and start it. Now I want to make some forms that should show the content of an URL. I did it like your SimpleBrowser example. When I open it and wait, eveything goes fine. When I move it during of creating/navigate the process stucks and no event (ControllerCompleted nor AfterCreated) got invoked. Now nothing helps excepts restarting the whole application. When I open one form und then open an other form and move the first one over the second one while the second one is waiting on the next event after CreatingBrowser the process got stuck. Nothing helps excepts restarting the whole application... Sometime I got theInitializationError: The parent windows was destroyes before the controller creation was finished. What should I do when the forms closes und the creation was not finished?

Do you know what I'm doing wrong or are that limitations of the WebView2?

salvadordf commented 1 year ago

Hi,

There's an open issue in the feedback repository about using WebView2 inside a DLL. I'm not sure if this can be done but some Microsoft developer will answer that question.

That error happens when the ICoreWebView2Environment.CreateCoreWebView2Controller call fails with an E_ABORT error.

Read this for all the details about that function.

The official WebView2 demo uses WebView2 outside a DLL but it has these code comments for that error code : "Webview creation was aborted because the user closed this window. No need to report this as an error."