There's a helpful blog post about the problem in the Visual C++ Team Blog.
The important point is that there are two #defines that force the manifest to point to the newer DLLs:
#define _BIND_TO_CURRENT_CRT_VERSION 1
#define _BIND_TO_CURRENT_MFC_VERSION 1
There's a single #define that does the same thing, but it's broken in the Feature Pack. [9/7/2008 - It's fixed in Service Pack 1. Thanks "anonymous"!]
#define _BIND_TO_CURRENT_VCLIBS_VERSION 1
The blog points out that defining the explicit BIND macros is not always the right thing to do.
This problem bit me because I was following the directions in this blog post, which call for making copies of certain directories from Debug_NonRedist. In a system where the CRT and MFC DLLs have been installed, there are pointers in the registry from the old versions of the DLLs to the new versions, so everything "just works." However, when using the Debug_nonRedist directories, these redirect pointers don't exist. Since the manifest was calling for the old versions of the DLLs, the application wouldn't open.
If you get error c101008a, either Rebuild All or delete all of your "xxx.exe.embed.manifest" files and build the solution.
thankfully
ReplyDelete#define _BIND_TO_CURRENT_VCLIBS_VERSION
is working now in VS 2008 SP1 (which includes the feature pack classes)