我在我的 win32 应用程序中使用 CEF3(chrome 嵌入式框架),当我运行该应用程序时,我收到一条奇怪的错误消息 -
我有 C# 开发背景,而在 C++ 中,我不知道如何检查我的错误并弄清楚它为什么提示我的代码。 如何查看错误消息?如果不是 - 您如何在 Visual Studio 中调试此类错误?
这是触发错误的代码 -
case WM_CREATE:
{
CefRefPtr<CefClient> clientHandler = new ClientHandler();
RECT rect;
GetClientRect(hWnd, &rect);
CefWindowInfo info;
info.SetAsChild(hWnd, rect);
// Browser initialization settings.
CefBrowserSettings settings;
// Create the new browser window object asynchronously.
std::string startupUrl = "http://www.google.com/";
CefBrowserHost::CreateBrowser(info, clientHandler, startupUrl, settings);
}
break;
我不需要 CEF3 方面的帮助(但我会很感激)我只是想知道如何在 Visual Studio 中调试此类错误。
最佳答案
调试器的输出窗口会告诉您抛出了什么异常。
此外,您可以在出现的对话框中单击“Break”,VS 会将您带到抛出异常的行。您会在该行的左侧看到一个黄色箭头。
最后,如果异常不是致命的,你可以捕获它并忽略它:
try
{
...
}
catch (const SomeException&)
{
// do nothing
}
关于c++ - 调用 CefBrowserHost::CreateBrowser 时出现 Visual Studio C++ 奇怪的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14080914/