FNCMaps and Edge-version

Hi TMS,

If I drop a TMSFNCMaps on a form (FMX) it works immediately.

If I put a TMSFNCMaps on a frame, and create the frame at runtime, it first shows 2 times:
"Could not initialize Edge Chromium! Please check Edge Chromium installation and verify correct version number."

After pressing OK twice, the google map appears and all works fine.

What's the difference?

My Edge version is 96.0.1054.62

Cheers,
John

We couldn't reproduce this issue here, can you provide a sample?

FYI, I'm here with the same thing. First time I've tried to use it since before Christmas. Except mine will not initialize at runtime with the same error message.

This is a project that was running fine before December 17

Looks like that version of Edge came out December 17

It's failing in unit FMX.TMSFNCWebBrowser.Win around line 1300 in my version

if (pth <> '') and DirectoryExists(pth) then
  **h := CreateCoreWebView2EnvironmentWithOptions(PWideChar({$IFDEF LCLLIB}UTF8Decode{$ENDIF}(pth)), PWideChar({$IFDEF LCLLIB}UTF8Decode{$ENDIF}(FFullCacheFolderName)), nil, TCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler.Create(Self))**
else
  h := CreateCoreWebView2EnvironmentWithOptions(nil, PWideChar({$IFDEF LCLLIB}UTF8Decode{$ENDIF}(FFullCacheFolderName)), nil, TCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler.Create(Self));

if h <> S_OK then
  FEdgeLocation := '';

if h = S_OK then
  WaitForInitialization
else if not FWebControl.IsDesignTime and not EdgeSilentErrors then
  TTMSFNCUtils.Message(EErrorMessage);  <<<<<<<<<<

I installed the EverGreen installer found here:

https://developer.microsoft.com/en-us/microsoft-edge/webview2/#download-section

It fixed it.

I istalled the Evergreen stuff as well, but it makes no difference.
The error says to check the version of Edge, but what to check?
It doesn't say what the version number should be...
Further it's pretty strange that the error pops up two times, and then everything works as expected...

Interesting. I put breakpoints in my code and saw that it was trying to initialize chromium multiple times, even though I only have one instance. Maybe that is what you are seeing.

Did you make sure you have the dlls in System32 and SysWow64?

https://www.tmssoftware.com/site/edgechromium.asp

Yes, they are both there.
And it happens in both Win32 and Win64 versions.

Are you sure you copied the latest versions of the DLLs?

EdgeDLLs.zip (125.4 KB)

Are you sure you copied the latest versions of the DLLs?

Yes.
It must me something in my code. The demo programs work without a problem.

Feel free to send us your sample that demonstrates the issue. We can help identify the issue.

Ok, I think I found the issue.
On the form, I have a TRectangle, created at designtime

On a Tframe, I have a TPanel. On the Panel there is the TTMSFNCMAPS.
The frame is filled with the TPanel and the TTMSFNCMAPS at designtime

The TFrame is created at runtime and put on the Rectangle.

Appearantly this is nested to deep for the initialisation logic to get a THandle to the mainform.
Hence the error occurs.
If I leave out the TPanel (and put the TTMSFNCMAPS directly on the Tframe), there is no error.

The error is triggered here in FMX.TMSFNCWebBrowser.Win:


  if not FWebControl.IsDesignTime
     then
    begin
      if FError and not EdgeSilentErrors
      then  TTMSFNCUtils.Message(EErrorMessage); //<----
    end
    else
      LoadDefaultHTML;

I commented it out for the moment.

We know there are issues related to frames. Please note that the web browser creates a native window that needs a valid handle. You can try to use a Deinitialize and then afterwards an Initialize call, to properly initialize the browser once the frame is created and there is valid handle.

Ok, thanks for the clarification!