Jump to content
hsvandrew

TEdgeBrowser - how to fix a blank display

Recommended Posts

Just in-case it helps someone, I've spent hours trying to work out why my TEdgeBrowser (chromium) was blank in one app, whilst working fine in the simple demo app.

Turns out CoInitializeEx(nil,COINIT_MULTITHREADED); will stop TEdgeBrowser from working.

This adjustment replaces CEF4Delphi, where this method was called and all worked ok.

Of course you also need the WebView2Loader.dll in the same folder as your application and to have installed Chromium Edge.

Share this post


Link to post

Good catch, that would have taken me hours as well.

 

For the sake of completion, here is the official documentation on the matter:

Quote

The WebView2 control is based on the Component Object Model (COM) and must run on a Single Threaded Apartments (STA) thread.

Threading model for WebView2 apps - Microsoft Edge Development | Microsoft Learn

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

×