When registering a DLL using Regsvr32, you get this error:
The module “dll” was loaded but the call to DllRegisterServer failed with error code 0x80020009
If your DLL was loaded but the call to DllRegisterServer failed, this is probably because you have not run the command prompt in administrator mode. Close the command prompt, hold Shift and right click the shortcut to the command prompt, click Run as Administrator.
❗ Note: Running regsvr32 when logged on as an administrator of the computer is not the same as right click and Run as Administrator!
Re-run the command and the DLL should then register without error code 0x80020009.