Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

February 5, 2008

How to Register an ActiveX DLL on Vista with regsvr32

Let me begin by saying: Vista = pain + time + frustration.

This article will get you through the minefield of registering an ActiveX DLL with regsvr32 on Vista. I’ll step you through all the pitfalls…

1) First, create a .bat in the same directory as your DLL. Add this single line to your .bat:

regsvr32 myThingy.dll

Now run it. Here’s the error message you’ll get:

The module "myThingy.dll" was loaded but the call to DllRegisterServer failed with error code 0×8002801c.

For more information about this problem, search online using the error code as a search term.

When will Microsoft learn that error codes suck? They’re useless. Perhaps a message such as "Security paranoid Vista didn’t let you register the DLL because writing to the registry is extremely dangerous." would be better, because that’s exactly what 0×8002801c means. Isnt’ it obvious? (Also — isn’t Microsoft adding to Google’s dominance of the search market by telling programmers to "search the web"?)

2) OK, you’re smart and you know how to get around this problem. Right-click the .bat file and choose "Run as Administrator". That ought to do it!

But now you get this error (after you click on yet another dialog box giving permission to continue):

The module "myThingy.dll" failed to load.

Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.

The specified module could not be found.

OK, at least you didn’t get an error code. But it’s worse — you’ve been misdirected. You’re reasoning will be this: My specified path is the current working directory because I didn’t specify a path for my DLL, and since the .bat file is located in the same directory as my DLL, it must be OK.

So now you fire up "depends.exe" and check to see what it says. Aha! There’s the missing dependency — dwmapi.dll!
What is it and why is it missing on my system? You waste the rest of the afternoon trying to track it down, but to no avail…

It turns out that dwmapi.dll is not the problem at all. The real problem is that when regsvr32 runs, it’s current working directory changes to \Windows\System32 — so it couldn’t find your myThingy.dll after all!

Change your .bat script to use the full, absolute path. For example:

regsvr32 c:\myApp\myThingy.dll

Right-click on the .bat, select "Run as Administrator", give permission to Vista to continue however often it asks, and voila! The DLL is registered.

That was easy. I love Vista.


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.