32 位 DLL“可能不兼容"在 Server 2008 上,但适用于 Server 2003 [英] 32-bit DLL "may not compatible" on Server 2008, but works on Server 2003

查看:44
本文介绍了32 位 DLL“可能不兼容"在 Server 2008 上,但适用于 Server 2003的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个项目可以编译为 32 位 COM DLL 和 64 位 COM DLL(来自 我之前的问题).当我在我的 Windows 7 机器上注册两者时,两者都注册成功.当我在 Windows Server 2003 机器上注册两者时,两者都注册成功.

We have a project that compiles to a 32-bit COM DLL and to a 64-bit COM DLL (the same one from my earlier question). When I register both on my Windows 7 machine, both register successfully. When I register both on a Windows Server 2003 machine, both register successfully.

但是当我尝试在 Windows Server 2008 R2 标准 SP1 机器上注册 DLL 时,64 位 DLL 注册成功,但 32 位 DLL 失败带有消息(原文如此):

But when I try to register the DLLs on a Windows Server 2008 R2 standard SP1 machine, the 64-bit DLL registers successfully, but the 32-bit DLL fails with the message (sic):

模块%1"可能与您运行的 Windows 版本不兼容.检查模块是否与 regsvr32.exe 的 x86(32 位)或 x64(64 位)版本兼容.

我认为 32 位 DLL 不能与 WS2003 和 Win7 兼容,但不能与 WS2008 兼容.这毫无意义.

I don't think a 32-bit DLL can be compatible with WS2003 and Win7 but not WS2008. That makes no sense.

可能会发生什么?

推荐答案

Regsvr32.exe 的版本必须与您尝试注册的 dll 的 32 位/64 位匹配.64 位 regsvr32 无法加载 32 位 dll,反之亦然.

The version of Regsvr32.exe must match the 32-/64-bitness of the dll you're trying to register. The 64-bit regsvr32 cannot load a 32-bit dll, and vice versa.

您可能需要显式调用位于 %systemroot%SysWoW64 egsvr32.exe 中的 32 位版本的 regsrv32.

You may need explicitly call the 32-bit version of regsrv32 located in %systemroot%SysWoW64 egsvr32.exe.

来自 http://support.microsoft.com/kb/249873

Regsvr32.exe 包含在 Microsoft Internet Explorer 3.0 或更高版本、Windows 95 OEM Service Release 2 (OSR2) 或更高版本以及 Windows NT 4.0 Service Pack 5 (SP5) 或更高版本中.Regsvr32.exe 安装在 System (Windows Me/Windows 98/Windows 95) 或 System32 (Windows NT/Windows XP/Windows Vista/Windows 7) 文件夹中.

Regsvr32.exe is included with Microsoft Internet Explorer 3.0 or later versions, Windows 95 OEM Service Release 2 (OSR2) or later versions, and Windows NT 4.0 Service Pack 5 (SP5) or later versions. Regsvr32.exe is installed in the System (Windows Me/Windows 98/Windows 95) or System32 (Windows NT/Windows XP/Windows Vista/Windows 7) folder.

注意在 64 位版本的 Windows 操作系统上,Regsv32.exe 文件有两个版本:

Note On a 64-bit version of a Windows operating system, there are two versions of the Regsv32.exe file:

  • 64 位版本是 %systemroot%System32 egsvr32.exe.
  • 32 位版本是 %systemroot%SysWoW64 egsvr32.exe.

Regsvr32.exe 使用RegSvr32.exe 具有以下命令行选项:Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

Regsvr32.exe usage RegSvr32.exe has the following command-line options: Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

/u - 注销服务器/i - 调用 DllInstall 并传递一个可选的 [cmdline];与/u 一起使用时调用 dll 卸载/n - 不调用 DllRegisterServer;此选项必须与/i 一起使用/s – 静音;不显示消息框(随 Windows XP 和 Windows Vista 添加)当您使用 Regsvr32.exe 时,它​​会尝试加载该组件并调用其 DLLSelfRegister 函数.如果此尝试成功,Regsvr32.exe 将显示一个指示成功的对话框.如果尝试不成功,Regsvr32.exe 将返回一条错误消息.这可能包括 Win32 错误代码.有关详细信息,请单击下面的文章编号以查看 Microsoft 知识库中的文章:193625 WinInet 错误代码(12001 到 12156)

/u - Unregister server /i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall /n - do not call DllRegisterServer; this option must be used with /i /s – Silent; display no message boxes (added with Windows XP and Windows Vista) When you use Regsvr32.exe, it attempts to load the component and call its DLLSelfRegister function. If this attempt is successful, Regsvr32.exe displays a dialog box that indicates success. If the attempt is unsuccessful, Regsvr32.exe returns an error message. This may include a Win32 error code. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 193625 WinInet error codes (12001 through 12156)

这篇关于32 位 DLL“可能不兼容"在 Server 2008 上,但适用于 Server 2003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆