Visual Studio Strange Exception
Visual Studio Strange Exception
我将一个项目从Visual Studio Express(Windows SDK x64 with CMake)移植到Visual Studio 2010 Professional(针对x64编译)。一切似乎都正常。我可以编译我转换的.dll项目。进入我的测试项目时,我面临着一种奇怪的行为。(链接/包含库的设置方式相同)。
编辑 发布/调试也会发生同样的情况。
我收到以下错误(当我在Visual Studio 2010中运行代码时):
KernelBase.dll!RaiseException() + 0x3d bytes
msvcr100.dll!_CxxThrowException() + 0x81 bytes
000007fe8d54a043()
000007fe8d548700()
000007fe8d547d20()
000007fe8d547cee()
000007fe8d547c79()
clr.dll!000007feecbc822e()
[Frames below may be incorrect and/or missing, no symbols loaded for clr.dll]
kernel32.dll!BaseThreadInitThunk() + 0xd bytes
ntdll.dll!RtlUserThreadStart() + 0x21 bytes
多亏了这些家伙帮我调试,问题才得以解决。。。
所以交易是这样的:
我正在创建多个输出窗口。他们每个人都有不同的线索。在初始化部分,我有以下代码:
m_wndclassName = L"Output App"; // Here's the bug, the names should be different ...
m_wndclass.style = 0;
m_wndclass.lpfnWndProc = (WNDPROC)OpenGLSinkNode::wndProc;
m_wndclass.cbClsExtra = 0;
m_wndclass.cbWndExtra = 0;
m_wndclass.hInstance = NULL;
m_wndclass.hIcon = LoadIcon(NULL, m_wndclassName.c_str());
m_wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
m_wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
m_wndclass.lpszMenuName = m_wndclassName.c_str();
m_wndclass.lpszClassName = m_wndclassName.c_str();
解决方案:
m_wndclassName = L"Output App"; + std::to_wstring( (long double)m_id); // watch out here because std::to_wstring() has a bug ... you have to cast it to (long double), my_id of type int (Only in VS 2010, I read.)
相关文章:
- 为重写std::exception的库生成swig接口时出错
- 什么是 std::exception::what() 以及为什么要使用它?
- 链表"exception thrown"
- 为什么程序员同时使用 std::bad_alloc 和 std::exception.是否 std::例外 仅是不够的
- C++ broken_promise exception
- 请参阅在 Visual Studio 2019 中捕获 std::exception 时对函数模板实例化消息的引用
- QVTKWidget SetRenderWindow() with PCLVisualizer Exception
- 自定义派生的 std::exception 类的 'what' 函数返回神秘的废话
- 使用flag、return、exception、goto或break中止过程
- 由于某种原因,我的代码中出现了 [json.exception.type_error.302]。我知道错误意味着什么,但我不知道哪里有故障
- Strange behavior of std::vector<{QString,int*}>
- 派生自 std::exception 的类的赋值运算符
- 尝试打印字符串时"Python Exception <class 'gdb.error'> There is no member named _M_dataplus."
- std::exception :使用虚函数和继承与变量
- MFC ODBC SQLConfigDataSource() Unhandled Exception
- 这段 C++ 代码的奇怪行为(std::wcout 和 std::exception)
- VTK 7.1.1: vtkX3DExporter exception
- 无法在"catch(const std::exception &ex)"中捕获 std::invalid_argument
- Visual Studio Strange Exception
- QThreadPool strange exception