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.