Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my DLL failing to register?

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?

like image 390
LeopardSkinPillBoxHat Avatar asked Dec 18 '25 00:12

LeopardSkinPillBoxHat


2 Answers

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/
like image 106
Andrey Avatar answered Dec 19 '25 14:12

Andrey


Most probable is because the embedded manifests. You should take a resource explorer application and check your DLLs for the embedded manifests. It might be that one of the dependent DLLs (or your DLL) require some versions of other DLLs which don't exists.

I got this message: "This application has failed to start because the application configuration is incorrect." in case of embedded manifest mistmatches.

like image 29
Cătălin Pitiș Avatar answered Dec 19 '25 14:12

Cătălin Pitiș



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!