0

我已经使用 MFC VC++ 开发了一个应用程序,并且我想针对从 XP 开始的所有 Windows 版本(Windows XP、Vista、7 和 8)。我在 VS2012 的 Windows 7 64 位机器上开发了该应用程序,它运行良好,但是当我尝试在 Vista 上运行它时,我收到以下消息:

“问题导致程序停止正常工作。Windows 将关闭程序并通知您是否有可用的解决方案”

这是该项目的其中一个属性页面的屏幕截图:

项目属性页

在我的 targetver.h 文件中,我有以下内容:

#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.


#include <winsdkver.h>

#define WINVER 0x0501
#define _WIN32_WINNT 0x0501

#include <SDKDDKVer.h>

谁能建议我可能做错了什么?还有哪些信息会有所帮助?

编辑

我已经重建了#include <SDKDDKVer.h>,但它仍然给出了错误。在 XP Mode 下运行时也会出现该错误。见下文:

XP 崩溃

编辑 2

我设法构建了一个默认的 MFC 单文档模板并在 XP Box 上运行它。这使我深入研究了两个应用程序之间的差异,这使我在应用程序执行后查看了输出窗格。在默认应用程序上输出:

'MFC_Test.exe' (Win32): Loaded 'C:\Users\ShaneH\Documents\Visual Studio 2012\Projects\MFC_Test\Release\MFC_Test.exe'. Symbols loaded.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sysfer.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msimg32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winspool.drv'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.18120_none_72d2e82386681b36\GdiPlus.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\apphelp.dll'
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'MFC_Test.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'MFC_Test.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file.
The program '[6972] MFC_Test.exe' has exited with code 0 (0x0).

看起来一切正常并且正常工作,然后从我的应用程序中输出:

'MemoryTest.exe' (Win32): Loaded 'C:\Users\ShaneH\Documents\Visual Studio 2012\Projects\MemoryTest\Release\MemoryTest.exe'. Symbols loaded.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sysfer.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msimg32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winspool.drv'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.18120_none_72d2e82386681b36\GdiPlus.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\apphelp.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\AppPatch\AcLayers.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mpr.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\AppPatch\AcGenral.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\samcli.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msacm32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sfc.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sfc_os.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\setupapi.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\devobj.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\urlmon.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\iertutil.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wininet.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\normaliz.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\AppPatch\AcXtrnal.dll'. Cannot find or open the PDB file.
FTH: (5088): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***
'MemoryTest.exe' (Win32): Loaded 'C:\Users\ShaneH\Documents\Visual Studio 2012\Projects\MemoryTest\Release\MemoryTest.exe'. Symbols loaded.
'MemoryTest.exe' (Win32): Unloaded 'C:\Users\ShaneH\Documents\Visual Studio 2012\Projects\MemoryTest\Release\MemoryTest.exe'
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shunimpl.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SortServer2003Compat.dll'. Cannot find or open the PDB file.
First-chance exception at 0x01080DD5 in MemoryTest.exe: 0xC0000005: Access violation reading location 0x000000D0.
First-chance exception at 0x01080DD5 in MemoryTest.exe: 0xC0000005: Access violation reading location 0x000000D0.
First-chance exception at 0x01080DD5 in MemoryTest.exe: 0xC0000005: Access violation reading location 0x000000D0.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\ole32.dll'
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file.
'MemoryTest.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file.
The program '[5088] MemoryTest.exe' has exited with code 0 (0x0).

什么是:

  • * 容错堆垫片应用于当前进程。这通常是由于以前的崩溃造成的。*
  • MemoryTest.exe 中 0x01080DD5 处的第一次机会异常:0xC0000005:访问冲突读取位置 0x000000D0?

可能更重要的是,我该如何修复它们。该应用程序在 Windows 7 上运行良好,但在 XP 上却不行。

编辑 3

阅读这篇文章似乎我需要检查我的指针,因为这可能是问题的原因。

4

0 回答 0