I am using VS2019 to write code and the CEF version I am using is 101. I created a dialog box project for MFC and created a CEF browser window in the dialog box. When I close the dialog box, I cannot call the doclose() function of CEF, so I cannot close CEF properly. How should I write code?
BOOL CMFCAppApp::InitInstance() I initialize CEF
CefRefPtr<SimpleApp> app(new SimpleApp);
// Initialize CEF.
CefInitialize(main_args, settings, app.get(), sandbox_info);
BOOL CMFCAppDlg::OnInitDialog() I create the browser
info.SetAsChild(m_hWnd, cefRect);
CefBrowserHost::CreateBrowser(info, mCefHandler, "https://www.baidu.com",
browserSettings,
nullptr, nullptr);