MFC VC ++应用程序在Vista和XP上崩溃

时间:2013-09-04 05:55:06

标签: visual-c++ visual-studio-2012 deployment mfc

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

“问题导致程序无法正常工作。如果解决方案可用,Windows将关闭程序并通知您”

以下是该项目的一个属性页面的屏幕截图:

Project Property Pages

在我的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模式下运行时也会出现错误。见下文:

XP Crash

编辑2

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

'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

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

0 个答案:

没有答案