[Solved] Cannot get any multi-process code to load a page.

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.

Re: Cannot get any multi-process code to load a page.

Postby ScottD » Tue Feb 07, 2017 4:22 pm

amaitland wrote:Your code doesn't make a whole lot of sense. How about you start at the beginning?

What are you trying to achieve? What platform are you using? What frameworks/technologies?


I'm just trying to get the bare bones needed to implement off-screen-rendering and JavaScript support on Windows (with an eye to Linux and Mac later). There's basically nothing implemented in my sample code because I'm just trying to get to grips with CEF3. That's why my handlers are just log statements and a couple stubbed in values - I want to see what CEF3 is doing.

I've read the cefsimple, cefclient, and other samples. I don't see what I'm doing that they're not... or vice versa. :-(
ScottD
Techie
 
Posts: 20
Joined: Mon Jan 30, 2017 5:22 pm
Location: Smithton, IL, USA, Earth

Re: Cannot get any multi-process code to load a page.

Postby amaitland » Tue Feb 07, 2017 5:09 pm

Can you roughly explain how cefsimple is structured? Where is the browser created?

Are you integrating with an existing message loop?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Cannot get any multi-process code to load a page.

Postby ScottD » Tue Feb 07, 2017 5:20 pm

amaitland wrote:Can you roughly explain how cefsimple is structured? Where is the browser created?

Are you integrating with an existing message loop?


Yeah. cefsimple on Windows starts in the cefsimple_win.cc file. It sets up CEF, hands it an instance of SimpleApp from simple_app.cc, and enters the message loop. SimpleApp creates the browser instance in the OnContextInitialized callback.

Based on this, it might be possible I'm creating a browser before CEF is ready. Although I'd expect to get no callback events in that case.

And, yes, I want to use an existing message loop. Eventually this will land in a game engine.
ScottD
Techie
 
Posts: 20
Joined: Mon Jan 30, 2017 5:22 pm
Location: Smithton, IL, USA, Earth

Re: Cannot get any multi-process code to load a page.

Postby ScottD » Tue Feb 07, 2017 5:33 pm

ScottD wrote:Based on this, it might be possible I'm creating a browser before CEF is ready. Although I'd expect to get no callback events in that case.


Waiting on the context does not change the behavior. :sad:
ScottD
Techie
 
Posts: 20
Joined: Mon Jan 30, 2017 5:22 pm
Location: Smithton, IL, USA, Earth

Re: Cannot get any multi-process code to load a page.

Postby magreenblatt » Tue Feb 07, 2017 7:25 pm

Off-screen rendering is necessarily complex and will not work if you implement the callbacks incorrectly. I suggest you start with a working example and go backwards from there instead of trying to implement it from scratch. There are examples in cefclient and a number of existing game engines (you can Google for those).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Cannot get any multi-process code to load a page.

Postby ScottD » Tue Feb 07, 2017 7:31 pm

magreenblatt wrote:Off-screen rendering is necessarily complex and will not work if you implement the callbacks incorrectly. I suggest you start with a working example and go backwards from there instead of trying to implement it from scratch. There are examples in cefclient and a number of existing game engines (you can Google for those).


The OSR part doesn't bother me. I can't even get the main loop to run properly. Why does it work single-threaded but not multi-threaded?
ScottD
Techie
 
Posts: 20
Joined: Mon Jan 30, 2017 5:22 pm
Location: Smithton, IL, USA, Earth

Re: Cannot get any multi-process code to load a page.

Postby ScottD » Sat Mar 18, 2017 5:21 pm

Solved! I've been using QtCreator as an IDE. Turns out you MUST use the manifest file on Windows or CEF is very unhappy.

Stupid Windows.
ScottD
Techie
 
Posts: 20
Joined: Mon Jan 30, 2017 5:22 pm
Location: Smithton, IL, USA, Earth

Re: [Solved] Cannot get any multi-process code to load a pag

Postby fokz » Thu Apr 06, 2017 6:28 am

Your renderer process was crashing. For future problems remember to consult generated log file and I would recommend VS on Windows with extension that enables you to debug child processes as well
fokz
Techie
 
Posts: 22
Joined: Sat Jun 18, 2016 10:53 am

Previous

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 59 guests