CEF is trying to connect to the MFC but nothing happens.
I do so:
1. Create a project, IFC
2. copy the folder including a header
3. To copy all the debug folder
4. CPP file prescribe
- Code: Select all
#pragma comment(lib,"libcef_dll_wrapper.lib")
#pragma comment(lib,"libcef.lib")
#pragma comment(lib,"cef_sandbox.lib")
5. connect the header files in the file beginning cpp
- Code: Select all
#include "simple_handler.h"
#include "include/cef_browser.h"
#include "include/cef_command_line.h"
#include "include/wrapper/cef_helpers.h"
6. copy files to a project simple_handler.h and simple_handler.cpp
7. add to the function OnInitDialog code
- Code: Select all
CEF_REQUIRE_UI_THREAD();
// Information used when creating the native window.
CefWindowInfo window_info;
#if defined(OS_WIN)
// On Windows we need to specify certain flags that will be passed to
// CreateWindowEx().
window_info.SetAsPopup(NULL, "cefsimple");
#endif
// SimpleHandler implements browser-level callbacks.
CefRefPtr<SimpleHandler> handler(new SimpleHandler());
// Specify CEF browser settings here.
CefBrowserSettings browser_settings;
std::string url;
// Check if a "--url=" value was provided via the command-line. If so, use
// that instead of the default URL.
CefRefPtr<CefCommandLine> command_line =
CefCommandLine::GetGlobalCommandLine();
url = command_line->GetSwitchValue("url");
if (url.empty())
url = "http://www.google.com";
// Create the first browser window.
CefBrowserHost::CreateBrowser(window_info, handler.get(), url,
browser_settings, NULL);
collect application, everything is going without errors, but when the application crashes. The debugger shows an unhandled exception.
How to connect in MFC connect CEF, it does not work