network services crashed in a MFC dialog based application
Posted: Wed Dec 30, 2020 3:17 am
It doesn't work when using multi-process mode.How can I fix this?
DEBUG MESSAGE: ERROR:Network service crashed, restarting service.
DEBUG MESSAGE: ERROR:Network service crashed, restarting service.
- Code: Select all
// CefDemo.cpp
BOOL CCefDemoApp::InitInstance()
{
if (InitCef() >= 0)
return FALSE;
CWinApp::InitInstance();
// code created by wizard
// ...
UninitCef();
return FALSE;
}
int CCefDemoApp::InitCef()
{
CefEnableHighDPISupport();
void *sandbox_info = nullptr;
CefMainArgs main_args(AfxGetApp()->m_hInstance);
CefSettings settings;
settings.no_sandbox = true;
settings.multi_threaded_message_loop = true;
settings.log_severity = LOGSEVERITY_ERROR;
CefRefPtr<SimpleApp> app(new SimpleApp);
m_bCefInited = CefInitialize(main_args, settings, app.get(), sandbox_info);
int exit_code = CefExecuteProcess(main_args, nullptr, sandbox_info);
if (exit_code >= 0) {
// The sub-process has completed so return here.
return exit_code;
}
return -1;
}
void CCefDemoApp::UninitCef()
{
if (m_bCefInited)
CefShutdown();
}