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

那年仲夏 提交于 2019-12-11 01:38:02

问题


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:

The command I use is regsvr32 my_x64_com_server.dll

Why is this happening and is there a workaround?

Thanks in advance.


回答1:


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.



来源:https://stackoverflow.com/questions/15778383/how-to-register-a-64-bit-com-dll-on-64-bit-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!