Build fails in Debug Mode

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.

Build fails in Debug Mode

Postby rsharma07 » Tue Nov 24, 2020 5:42 am

I am working on a cef project. I am using gtest in my browser project in which CreateBrowser method gives an error in Debug mode where as in Release mode it works fine.
Error Message:
[1124/143308.820:FATAL:browser_host_impl.cc(245)] Check failed: false. context not valid

Due to this a post-build command in Visual Studio also gives error.

Can anyone please help me, how can i solve this problem?

Window version 1809
CEF Version 81
Building on Visual Studio 2017
rsharma07
Techie
 
Posts: 17
Joined: Wed Oct 21, 2020 4:12 am

Re: Build fails in Debug Mode

Postby magreenblatt » Tue Nov 24, 2020 1:47 pm

It sounds like you're calling CreateBrowser at the wrong time. It needs to be called on the UI thread after CefInitialize. See example usage in the sample applications.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Build fails in Debug Mode

Postby rsharma07 » Wed Nov 25, 2020 8:21 am

Okay!
But how can it be work in Release mode? If i do not call cefinitialize() then error should be come from both Release and Debug mode ?
rsharma07
Techie
 
Posts: 17
Joined: Wed Oct 21, 2020 4:12 am

Re: Build fails in Debug Mode

Postby magreenblatt » Wed Nov 25, 2020 10:29 am

Is it working in Release mode, or just failing silently?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Build fails in Debug Mode

Postby rsharma07 » Fri Nov 27, 2020 7:28 am

In Release mode, CreateBowser returns false where as in Debug mode, CreateBrowser gives an exception with this message in output window : >[1127/174922.045:FATAL:browser_host_impl.cc(245)] Check failed: false. context not valid
rsharma07
Techie
 
Posts: 17
Joined: Wed Oct 21, 2020 4:12 am

Re: Build fails in Debug Mode

Postby magreenblatt » Fri Nov 27, 2020 12:03 pm

In Release mode, CreateBowser returns false

This means that it’s not working in Release mode either.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Build fails in Debug Mode

Postby rsharma07 » Tue Dec 29, 2020 7:46 am

Hi @magreenblatt
Sorry to disturb you again.
Can you tell me the all dependencies for createBrowser method ? Is it necessary to initialize cef before call to createBrowser? I am using createBrowser method in a gtest.
rsharma07
Techie
 
Posts: 17
Joined: Wed Oct 21, 2020 4:12 am

Re: Build fails in Debug Mode

Postby magreenblatt » Tue Dec 29, 2020 4:46 pm

I suggest you look at (or start with) ceftests which also uses gtest.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

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