Why is my DLL failing to register?
c++, com, dll, registry
Solution
Microsoft had recently released a Security Update for ATL (KB971090). It is un update on top of MSVS2005sp1 and it's both compilate-time and runtime compatibility breaker. Check if your building environment has this patch.
References:
- ATL Security Update: http://msdn.microsoft.com/en-us/visualc/ee309358.aspx
- Breaking changes in ATL: http://msdn.microsoft.com/de-de/library/ms235654.aspx
- And this is a must read: http://tedwvc.wordpress.com/2009/08/10/avoiding-problems-with-vc2005-sp1-security-update-kb971090/
Problem
I am building a project in VS2005 and several of my DLLs are failing to register. The error message I am getting in Visual Studio is: Project : error PRJ0019: A tool returned an error code from "Registering ActiveX Control..." which is nicely vague. When I register the DLL manually through the command line (using `regsv32.exe`, I get the following error: LoadLibrary("test.ocx") failed - This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem. I ran Dependency Walker (`depends.exe`) on the culprit .ocx file but it isn't showing any obvious problems. I have also done a re-build but I'm still getting the same problem. Any suggestions as to how I could determine the cause of this failure to register?