faulty CEF initialization

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

faulty CEF initialization

Postby IvanPong1 » Thu Jul 29, 2021 2:24 am

Hi,

I have an issue where initializing CEF and creating a browser in OnContextInitialized leads to a browser that doesn't work. If I put a sleep statement in the before initializing the browser, the page usually loads. This is using the multi threaded message loop with an external exe taking care of CEF subprocesses. Since I'm integrating CEF with a pre-existing project, I cannot switch to either the single process, single threaded architectures or have CEF implement the message loop.

To show this problem, I've uploaded a minimal example here: https://github.com/IvanPong/CEFStartupExample
it requires Visual Studio on Windows 10. cefstuff has a built version of the libcef wrapper, but you can build it
yourself if you want to. There's a text file with instructions, but basically just dump all lib and dll files in cefstuff and it should work.
12/08/2020 - 87.1.12+g03f9336+chromium-87.0.4280.88 / Chromium 87.0.4280.88 from
https://cef-builds.spotifycdn.com/cef_b ... 64.tar.bz2

I've built CEF and verified that the spotify CDN matches what I built. Additionally, I have tested my project with a more recent version of CEF and verified that the issue still occurs.

The expected output is that the bitmap creation tool in OnPaint creates a bitmap in a created folder called 'ouptut' as bing.com is loaded (this can be changed, but bing is colorful) With the sleep set, this does happen. In the current configuration, the browser outputs a single black bitmap, then quits.

I have only included the essentials for initialization, so the project just crashes when you close it.


Thanks for any suggestions! Let me know if you have any questions about how to get the project going, if you need to run it to see what's wrong.
IvanPong1
Techie
 
Posts: 13
Joined: Thu Aug 20, 2020 10:55 pm

Re: faulty CEF initialization

Postby amaitland » Thu Jul 29, 2021 2:36 am

Is this the same as your previous thread?

viewtopic.php?f=6&t=18470&p=49334#p49334
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1018
Joined: Wed Jan 14, 2015 2:35 am

Re: faulty CEF initialization

Postby IvanPong1 » Thu Jul 29, 2021 9:02 am

Yes, it's the same problem. You can merge threads if you want. The code I'm posting is substantially different in a number of ways from the code I was having issues with there though.
IvanPong1
Techie
 
Posts: 13
Joined: Thu Aug 20, 2020 10:55 pm

Re: faulty CEF initialization

Postby amaitland » Thu Jul 29, 2021 3:19 pm

Better to keep discussion in one thread.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1018
Joined: Wed Jan 14, 2015 2:35 am

Re: faulty CEF initialization

Postby IvanPong1 » Thu Jul 29, 2021 5:13 pm

ok, I'll keep that in mind in the future. Do you know what's going wrong in the initialization?
IvanPong1
Techie
 
Posts: 13
Joined: Thu Aug 20, 2020 10:55 pm

Re: faulty CEF initialization

Postby IvanPong1 » Fri Jul 30, 2021 9:37 am

Should I register this as a bug?

As far as I can tell, none of the CEF example applications due this -they wait for window initialization instead of initializing the browser directly.

However, it seems like this is supposed to be supported. At the very least, when setting it as single threaded I can get everything to work.
IvanPong1
Techie
 
Posts: 13
Joined: Thu Aug 20, 2020 10:55 pm

Re: faulty CEF initialization

Postby magreenblatt » Fri Jul 30, 2021 1:31 pm

IvanPong1 wrote:Should I register this as a bug?

As far as I can tell, none of the CEF example applications due this -they wait for window initialization instead of initializing the browser directly.

However, it seems like this is supposed to be supported. At the very least, when setting it as single threaded I can get everything to work.

Single-threaded mode is not supported. Please don't file a bug unless the problem reproduces with the CEF sample applications.
magreenblatt
Site Admin
 
Posts: 11094
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 16 guests