Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to register a 64-bit COM dll on 64-bit Windows 7?

I'm trying to register an x64 COM server dll for use in x64 office on x64 windows 7. I have followed the instructions here but I cannot register the dll. When I attempt to I get the following error:

regsvr error message

The command I use is regsvr32 my_x64_com_server.dll

Why is this happening and is there a workaround?

Thanks in advance.

like image 475
Pat Mustard Avatar asked Sep 03 '25 05:09

Pat Mustard


1 Answers

How is the command being run? From a process or from a command line?

Make sure the command is being run from a 64-bit process (or a 64-bit cmd.exe console window). Otherwise, the %windir%\System32\regsvr32.exe command will be redirected to %windir%\SysWoW64\regsvr32.exe and a 32-bit regsrv32 will be run (which can't register 64-bit DLLs).

You could also try using %windir%\sysnative\regsvr32.exe which will redirect to the real %windir%\System32\ directory (but only from a 32-bit process, so if you use that take care to make sure no one tries to run the command from a 64-bit process).

See File System Redirector on MSDN for details.

like image 108
Michael Burr Avatar answered Sep 05 '25 00:09

Michael Burr



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!