MFC VC++ App Crashes On Vista And XP

0

I have developed an application using MFC VC++ and I am want to target all versions of Windows from XP going forward (Windows XP, Vista, 7 and 8). I have developed the app on a Windows 7 64 bit machine in VS2012 and it works perfectly but when I attempt to run it on Vista I get the following message:

"A problem has caused the program to stop working correctly. Windows will close the program and notify you if a solution is available"

Here is a screenshot of one of the property pages of the project:

Project Property Pages

In my targetver.h file I have the following:

#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>

Can anyone suggest what I might be doing wrong? What other information would be helpful?

EDIT

I have rebuilt including the #include <SDKDDKVer.h> and it still gave the error. The error also appears when running in XP Mode. See below:

XP Crash

EDIT 2

I have managed to build a default MFC Single Document Template and run it on the XP Box. This lead me to dig into the differences between the two applications which lead me to look at the Ouput pane after the application has executed. On the default app this is outputed:

'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).

Which looks like everything is normal and working and then out output from my app:

'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).

What are:

  • * Fault tolerant heap shim applied to current process. This is usually due to previous crashes. *
  • And First-chance exception at 0x01080DD5 in MemoryTest.exe: 0xC0000005: Access violation reading location 0x000000D0?

And possibly more importantly, how do I fix them. The app runs fine on Windows 7, but it doesn't on XP.

Edit 3

Reading this post it seems I need to check my pointers as this might be the cause of the problem.

visual-c++
visual-studio-2012
deployment
mfc
asked on Stack Overflow Sep 4, 2013 by Shane Haw • edited Sep 4, 2013 by Shane Haw

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0