When you run Regsrv32.exe to register a DLL, you receive:

DllRegisterServer in <FileName>.dll failed.

Return code was: 0x80070005

If you are logged on with a user account that does NOT have administrative privileges, you will experience this behavior if the DLL file writes to the registry, or changes files in the %SystemRoot%\System32 folder.

To workaround this behavior, log on with an account that has administrative privileges.