最近几周我一直在运行Visual Studio和我开发的游戏的奇怪行为。
使用WIN32 CreateWindowExA
创建应用程序窗口后,我使用D3D11CreateDeviceAndSwapChain
初始化DX3D11(请参阅代码文件here中的第304行)。
在VisualStudio中,执行此行将始终导致调试输出中包含以下文本的崩溃:
First-chance exception at 0x7713C42D in SpaceLegends.exe: Microsoft C++ exception: _com_error at memory location 0x0032D7A0.
First-chance exception at 0x7713C42D in SpaceLegends.exe: Microsoft C++ exception: _com_error at memory location 0x0032D90C.
First-chance exception at 0x7713C42D in SpaceLegends.exe: Microsoft C++ exception: _com_error at memory location 0x0032D940.
First-chance exception at 0x7713C42D in SpaceLegends.exe: Microsoft C++ exception: _com_error at memory location 0x0032DA58.
First-chance exception at 0x7713C42D in SpaceLegends.exe: Microsoft C++ exception: _com_error at memory location 0x0032E248.
First-chance exception at 0x77B070B4 (ntdll.dll) in SpaceLegends.exe: 0xC0000005: Access violation reading location 0x00000000.
Critical error detected c0000374
SpaceLegends.exe has triggered a breakpoint.
但是当我像普通用户一样运行没有VS的exe时,启动应用程序没有任何问题。此外,没有日志条目报告任何困难或错误!
由于某些原因,我没有得到围绕特定代码行的try-catch不会在VS调试中触发,所以没有我可以告诉的异常消息.in
我无法想象这有什么问题,我也不知道如何解决甚至追踪这个问题。
编辑1: 从发生异常的那一刻开始的完整堆栈跟踪:
ntdll.dll!_RtlpBreakPointHeap@4() Unknown
ntdll.dll!_RtlpCoalesceFreeBlocks@16() Unknown
ntdll.dll!@RtlpFreeHeap@16() Unknown
ntdll.dll!_RtlFreeHeap@12() Unknown
ntdll.dll!_RtlDebugFreeHeap@12() Unknown
ntdll.dll!@RtlpFreeHeap@16() Unknown
ntdll.dll!_RtlFreeHeap@12() Unknown
ntdll.dll!_LdrpFinalizeAndDeallocateDataTableEntry@4() Unknown
ntdll.dll!_LdrpUnloadDll@8() Unknown
ntdll.dll!_LdrUnloadDll@4() Unknown
guard32.dll!003d6f12() Unknown
[Frames below may be incorrect and/or missing,
no symbols loaded for guard32.dll]
nvumdshim.dll!5dae52c4() Unknown
nvumdshim.dll!5dad777f() Unknown
[External Code]