gpt4 book ai didi

c++ - Visual Studio 奇怪的异常

转载 作者:太空宇宙 更新时间:2023-11-04 13:58:56 25 4
gpt4 key购买 nike

我将一个项目从 Visual Studio Express(带有 CMake 的 Windows SDK x64)移植到 Visual Studio 2010 Professional(为 x64 编译)。一切似乎都有效。我可以编译我转换的 .dll 项目。进入我的测试项目时,我遇到了一种奇怪的行为。 (链接/包含库的设置方式相同)。

编辑Release/Debug 也会发生同样的事情。

我收到以下错误(当我在 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.)

关于c++ - Visual Studio 奇怪的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20122681/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com