MFC VC++ を使用してアプリケーションを開発しましたが、XP 以降のすべてのバージョンの Windows (Windows XP、Vista、7 および 8) をターゲットにしたいと考えています。VS2012 の Windows 7 64 ビット マシンでアプリを開発しましたが、完全に動作しますが、Vista で実行しようとすると、次のメッセージが表示されます。
「問題が発生したため、プログラムが正しく動作しなくなりました。Windows はプログラムを終了し、解決策がある場合は通知します」
以下は、プロジェクトのプロパティ ページの 1 つのスクリーンショットです。
私の 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モードで実行しているときにもエラーが表示されます。下記参照:
編集2
デフォルトの MFC 単一ドキュメント テンプレートを作成し、XP Box で実行することができました。これにより、2 つのアプリケーションの違いを掘り下げ、アプリケーションの実行後に [出力] ペインを見るようになりました。デフォルトアプリでは、これが出力されます:
'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
この投稿を読むと、これが問題の原因である可能性があるため、ポインターを確認する必要があるようです。