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:
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:
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.