例外:
Exception thrown at 0x76EBC762 (KernelBase.dll) in MyMFC.exe:
0x0000071A: The remote procedure call was canceled, or if a call time-out
was specified, the call timed out.
尝试将CEF集成到MFC程序时遇到问题。
操作系统为windows10
,VS2017
,cef_binary_73.1.13
。
Cef设置如下:
CefSettings settings;
settings.multi_threaded_message_loop = false;
settings.ignore_certificate_errors = true;
settings.remote_debugging_port = 9000;
settings.external_message_pump = true;
CefDoMessageLoopWork
在MFC事件循环中运行。
我已经下载了pdb文件。退出程序时调用堆栈:
libcef.dll!content::ScreenlockMonitorDeviceSource::SessionMessageWindow::~SessionMessageWindow() Line 37 C++ Symbols loaded.
libcef.dll!content::ScreenlockMonitorDeviceSource::~ScreenlockMonitorDeviceSource() Line 15 C++ Symbols loaded.
libcef.dll!content::ScreenlockMonitor::~ScreenlockMonitor() Line 25 C++ Symbols loaded.
libcef.dll!std::unique_ptr<content::ScreenlockMonitor,std::default_delete<content::ScreenlockMonitor> >::~unique_ptr() Line 2267 C++ Symbols loaded.
libcef.dll!content::BrowserMainLoop::~BrowserMainLoop() Line 556 C++ Symbols loaded.
libcef.dll!content::BrowserMainLoop::~BrowserMainLoop() Line 552 C++ Symbols loaded.
libcef.dll!content::BrowserMainRunnerImpl::Shutdown() Line 236 C++ Symbols loaded.
libcef.dll!CefMainDelegate::ShutdownBrowser() Line 718 C++ Symbols loaded.
libcef.dll!CefContext::FinalizeShutdown() Line 587 C++ Symbols loaded.
libcef.dll!CefShutdown() Line 272 C++ Symbols loaded.
在破坏SessionMessageWindow
对象时,似乎程序异常:
SessionMessageWindow::~SessionMessageWindow() {
if (window_) {
::WTSUnRegisterSessionNotification(window_->hwnd()); <- HERE THROW EXCEPTION!
window_.reset();
}
}
我检查了变量window_
,它是在CefInitialize
内部创建的,它将创建一个用于接收会话更改通知的窗口,然后将其注册到::WTSRegisterSessionNotification(window_->hwnd(), ...)
我用Google搜索了几天,发现了一些有关CefShutdown异常的链接,但是在这种情况下,一切似乎都与众不同,这是由::WTSUnRegisterSessionNotification(window_->hwnd());
引起的
有人有什么想法吗? 预先感谢。