Discussion:
Custom - build step failing
(too old to reply)
NayJo
2009-11-09 20:01:24 UTC
Permalink
I have a VC++ project that creates an OCX file. I usually compile the
project with VS 2005 on a Windows 2000 PC but occasionally I have to compile
on a different PC running Windows XP SP2 using the same version of Visual
Studio. The custom build step fails on Windows XP machines but not on
Windows 2000 systems.

The custom build step is a call to regsvr32 which returns an errorlevel of 3
on the XP system.

I suspect this has something to do with SxS assemblies on Windows XP but do
not know how to configure the project to register correctly on XP.

Can anyone help?

Thank you in advance.
Scot Brennecke
2009-11-11 08:04:43 UTC
Permalink
Post by NayJo
I have a VC++ project that creates an OCX file. I usually compile the
project with VS 2005 on a Windows 2000 PC but occasionally I have to compile
on a different PC running Windows XP SP2 using the same version of Visual
Studio. The custom build step fails on Windows XP machines but not on
Windows 2000 systems.
The custom build step is a call to regsvr32 which returns an errorlevel of 3
on the XP system.
I suspect this has something to do with SxS assemblies on Windows XP but do
not know how to configure the project to register correctly on XP.
Can anyone help?
Thank you in advance.
Yes, most likely you have not installed the dependencies for your OCX on
the XP machine. The Dependency Walker tool
(http://www.DependencyWalker.com) is really helpful in diagnosing such
things.
You probably need to install SP1 for Visual Studio on your XP machine.
I'm guessing that you don't have the later versions of the VC
redistributable files on that machine. Since it's got VS2005, you
shouldn't have to install the stand-alone vcredist files, but you might
need the SP1 installed.
NayJo
2009-11-11 21:49:35 UTC
Permalink
Post by Scot Brennecke
Yes, most likely you have not installed the dependencies for your OCX on
the XP machine. The Dependency Walker tool
(http://www.DependencyWalker.com) is really helpful in diagnosing such
things.
You probably need to install SP1 for Visual Studio on your XP machine.
I'm guessing that you don't have the later versions of the VC
redistributable files on that machine. Since it's got VS2005, you
shouldn't have to install the stand-alone vcredist files, but you might
need the SP1 installed.
The dependency walker shows that MFC80D.DLL, MSVCR80D.DLL and MSVCP80D.DLL
cannot be located along with secondary associations with IESHIMS.DLL and
WER.DLL.. The search path order of depends.exe shows that it is looking for
side-by-side assemblies in
c:\Windows\WinSxS\x86_microsoft_windows.gdiplus_6595b64144ccf1df_1.0.6001.22
319.x-ww_f0b4c2df\GDIPLUS.DLL which doesn't look correct to me.

I have all manner of MFC80D.DLL and MSVC?80D.DLL in x86, ia64 and AMD64
folders under the Windows\WinSxS folder. I could install the bootstrap
vcredist as you mention but I am puzzled as to why that should be necessary.

The linker uses /NODEFAULTLIB and /MACHINE:X86. I noticed that WINVER was
defaulting to 0x0502 so I changed it to 0x0500 and 0x0501 but no
improvement.
Scot Brennecke
2009-11-14 08:32:36 UTC
Permalink
Post by NayJo
Post by Scot Brennecke
Yes, most likely you have not installed the dependencies for your OCX on
the XP machine. The Dependency Walker tool
(http://www.DependencyWalker.com) is really helpful in diagnosing such
things.
You probably need to install SP1 for Visual Studio on your XP machine.
I'm guessing that you don't have the later versions of the VC
redistributable files on that machine. Since it's got VS2005, you
shouldn't have to install the stand-alone vcredist files, but you might
need the SP1 installed.
The dependency walker shows that MFC80D.DLL, MSVCR80D.DLL and MSVCP80D.DLL
cannot be located along with secondary associations with IESHIMS.DLL and
WER.DLL.. The search path order of depends.exe shows that it is looking for
side-by-side assemblies in
c:\Windows\WinSxS\x86_microsoft_windows.gdiplus_6595b64144ccf1df_1.0.6001.22
319.x-ww_f0b4c2df\GDIPLUS.DLL which doesn't look correct to me.
I have all manner of MFC80D.DLL and MSVC?80D.DLL in x86, ia64 and AMD64
folders under the Windows\WinSxS folder. I could install the bootstrap
vcredist as you mention but I am puzzled as to why that should be necessary.
The linker uses /NODEFAULTLIB and /MACHINE:X86. I noticed that WINVER was
defaulting to 0x0502 so I changed it to 0x0500 and 0x0501 but no
improvement.
Do you really mean that your MFC80D and MSVCR80D DLLs are under x86,
ia64, and amd64 folders? They should not be under such folder names.
They should be under long folder names such as the one you listed for
GDIPlus.

If you have a correct installation of Visual Studio 2005 on that
machine, you shouldn't need to install the VCRedist.

The WINVER should not have anything to do with where it looks for the
dependencies.

Since the issue is related to a failure of registering an OCX, try
running the Process Monitor tool, and examining the file and registry
attempts of regsvr32 to see if any failures seem to correlate to the
registration failure.
NayJo
2009-11-17 18:39:51 UTC
Permalink
Post by Scot Brennecke
Do you really mean that your MFC80D and MSVCR80D DLLs are under x86,
ia64, and amd64 folders? They should not be under such folder names.
They should be under long folder names such as the one you listed for
GDIPlus.
If you have a correct installation of Visual Studio 2005 on that
machine, you shouldn't need to install the VCRedist.
The WINVER should not have anything to do with where it looks for the
dependencies.
Since the issue is related to a failure of registering an OCX, try
running the Process Monitor tool, and examining the file and registry
attempts of regsvr32 to see if any failures seem to correlate to the
registration failure.
When I was compiling on Windows 2000, I had turned off the "Generate
Manifest" setting in the Linker settings for the project. Moving the source
and project files to an XP machine and compiling without a manifest left the
ocx without enough information to find the dlls that regsvr32 needed to
register ocx file. Saying "Yes" to generate manifest fixed the issue and
now the custom build step succeeds.

ProcessMonitor was very useful in helping me figure this out. Thank you for
the suggestion.

BTW - the DLLs were in folders with long folder names. I was only trying to
point out that I had x86, ia64 and amd64 versions of the MFC and CRT dlls.

Thank you for your help.

J
Scot Brennecke
2009-11-19 09:12:54 UTC
Permalink
Post by NayJo
Post by Scot Brennecke
Do you really mean that your MFC80D and MSVCR80D DLLs are under x86,
ia64, and amd64 folders? They should not be under such folder names.
They should be under long folder names such as the one you listed for
GDIPlus.
If you have a correct installation of Visual Studio 2005 on that
machine, you shouldn't need to install the VCRedist.
The WINVER should not have anything to do with where it looks for the
dependencies.
Since the issue is related to a failure of registering an OCX, try
running the Process Monitor tool, and examining the file and registry
attempts of regsvr32 to see if any failures seem to correlate to the
registration failure.
When I was compiling on Windows 2000, I had turned off the "Generate
Manifest" setting in the Linker settings for the project. Moving the source
and project files to an XP machine and compiling without a manifest left the
ocx without enough information to find the dlls that regsvr32 needed to
register ocx file. Saying "Yes" to generate manifest fixed the issue and
now the custom build step succeeds.
ProcessMonitor was very useful in helping me figure this out. Thank you for
the suggestion.
BTW - the DLLs were in folders with long folder names. I was only trying to
point out that I had x86, ia64 and amd64 versions of the MFC and CRT dlls.
Thank you for your help.
J
You're welcome.
Indeed, on all OS versions XP and greater, the manifest is required, and
the WinSxS model is supported. Win2000 was the last OS version to not
support nor require the manifest and SxS.

Loading...