views:

4522

answers:

3

my mfc application created in visual studio 5 running on windows server 2000 sp4, i create a release for it and try running it win xp slp2. it gives me application failed to initialize properly (0xc0150002)

i have tried following things -Install Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) the one that comes within the release folder as well as one downloadable from website copied all dll and mainfest from microsoft visual sutdio\vc\redist

I still keep receiving the same messsage. c

what could be wrong?how can i fix it

A: 

some things to check:

  • check the /SUBSYSTEM linker option for you project. It might include OS major/minor version numbers.
  • ensure that you are using appropriate Windows XP PlatformSDK on DEV machine; check values of WINVER, _WIN32_WINNT
  • use depends to see whether the problem is in unresolved dependencies
  • check the version of runtime that your application requires with that on target machine. I usually do this by looking at the app's manifest from one side and into WinSxS folder of the target machine from another (recently there had been an ATL Security update from Microsoft http://msdn.microsoft.com/en-us/visualc/ee309358.aspx; new binaries created by updated Visual Studio will not run on machines that haven't the same updated version of runtime).
Andrey
A: 

It is possible you have applied a security update or compiler update to your VS2005 SP1. That makes it generate a manifest that requests a different MFC/CRT-dll than the one installed with Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) .

Try to use Depends.exe and open your application, then in the menu choose "Profile". Look in the output window below for a more detailed description.

Rolf Kristensen
A: 

Are you trying to run the debug version? That may give you an error similar to 0xc0150002. Try the release build, or you could compile against the static libraries rather than dynamic libraries. If you get this problem on a release build then the chances are that it's a missing dll (in which case try running Depends.exe) or an incorrect manifest.

If you have a missing dependency on a runtime dll you could try creating a deployment project for it as this will detect the appropriate runtime dlls and build it into an installer for you.

the_mandrill