如何在64位Windows 7上注册64位COM dll? [英] How to register a 64-bit COM dll on 64-bit Windows 7?
问题描述
我正在尝试注册x64 COM服务器dll,以便在x64 Windows 7上的x64 office中使用.我已按照说明进行操作
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:
我使用的命令是regsvr32 my_x64_com_server.dll
为什么会发生这种情况,并且有解决方法?
Why is this happening and is there a workaround?
谢谢.
推荐答案
命令如何运行?从进程还是从命令行?
How is the command being run? From a process or from a command line?
确保正在从64位进程(或64位cmd.exe控制台窗口)运行命令.否则,%windir%\System32\regsvr32.exe
命令将被重定向到%windir%\SysWoW64\regsvr32.exe
,并且将运行32位regsrv32(无法注册64位DLL).
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).
您也可以尝试使用%windir%\sysnative\regsvr32.exe
,它将重定向到真实的%windir%\System32\
目录(但仅从32位进程进行重定向,因此,请谨慎使用,以确保没有人尝试从a命令运行命令). 64位进程).
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).
有关详细信息,请参见 MSDN上的文件系统重定向器
See File System Redirector on MSDN for details.
这篇关于如何在64位Windows 7上注册64位COM dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!