What problem causes the createbrowser to return false?

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

What problem causes the createbrowser to return false?

Postby lin123 » Mon May 17, 2021 2:57 am

When I debugged, I found that the createbrowser interface returned false. What's the problem? The following is my code, I hope you can help me deal with the problem:
Code:
WebPush *web = new WebPush();
web->Create(IDD_DIALOG3);
CefWindowInfo window_info;
CRect rt;
rt.left = 0;
rt.right = 1000;
rt.top = 0;
rt.bottom = 500;
window_info.SetAsChild(GetSafeHwnd(), rt);
CefRefPtr<SimpleHandler> handler(new SimpleHandler(true));
CefBrowserSettings browser_settings;
std::string url;
url = "http://www.Google.com";
bool test = CefBrowserHost::CreateBrowser(window_info, handler.get(), url, browser_settings, NULL, NULL);
web->SetWindowPos(this, g_rect[1].left, g_rect[1].top, g_rect[1].right - g_rect[1].left, g_rect[1].bottom - g_rect[1].top, SWP_SHOWWINDOW);
lin123
Newbie
 
Posts: 2
Joined: Mon May 17, 2021 2:34 am

Re: What problem causes the createbrowser to return false?

Postby ndesktop » Mon May 17, 2021 9:00 am

Look into CefBrowserHost::CreateBrowser implementation. Other than incompatibilities (settings.size != sizeof(cef_browser_settings_t)) or invalid state, there is no fail.
Run your executable with --enable-logging --v=1 to see what error messages are displayed.
ndesktop
Master
 
Posts: 748
Joined: Thu Dec 03, 2015 10:10 am

Re: What problem causes the createbrowser to return false?

Postby lin123 » Wed May 19, 2021 8:50 pm

I use CEF_ binary_ 90.6.5_ In the development package of Windows 32, before calling the interface of createbrowser, do I have to call the interface of cefinitialize to initialize?
lin123
Newbie
 
Posts: 2
Joined: Mon May 17, 2021 2:34 am

Re: What problem causes the createbrowser to return false?

Postby amaitland » Wed May 19, 2021 9:07 pm

Yes, you must call CefInitialze and when you are finished CefShutdown

https://bitbucket.org/chromiumembedded/ ... t-function
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 5 guests