在Windows x64注册OCX/DLL组件

来源:互联网 发布:阿里云dns解析怎么用 编辑:程序博客网 时间:2024/05/21 17:39
  • 浏览器不能加载activeX控件/在64位的系统下,C:\Windows\System32,regsvr32注册OCX控件失败,提示dll或者路径什么的./不能在Windows 2008注册OCX失败。开启cmd.exe执行regsvr32 boo.ocx时传回错误讯息:

    The module "c:\windows\system32\boo.ocx” failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files. The specified module could not be found.
    无法加载模块 c:\windows\system32\boo.ocx"。 请确定二进制文件储存于指定的路径,或进行侦测以检查二进制文件或相依 .DLL 档是否发生问题。找不到指定的模块。

    虽然讯息指出问题出在找不到档案,但确定OCX档案是存在的,联想到问题可能出在Windows平台为x64,但OCX是用32位开发的关系。爬文后确认此点,在x64平台注册32位组件(OCX, DLL)应使用c:\windows\sysWOW64\regsvr32.exe,而非c:\windows\system32\regsvr32.exe! (发现有趣的事: system"32"下的regsvr32.exe是64位版,sysWOW"64"下的regsvr32.exe才是32位版。XD)

    将boo.ocx复制到c:\windows\sysWOW64,并使用同目录下的regsvr32.exe执行注册。以为就此打完收工,但又接到第二则错误讯息: www.it165.net

    "boo.ocx" was loaded but the call to DllRegisterServer failed with error code 0x80040200
    模块boo.ocx已加载, 但是呼叫 DllRegisterServer 失败, 错误码为 0x80040200

    原因: 同事因不熟悉UAC的缘故,在启动cmd.exe时未Run As Administrator提升为管理者权限,导致0x80040200权限不足错误(印象中,权限不足代码多为0x80004005,本例不然)。重新升为管理者权限执行cmd.exe,注册成功!  (from:  http://www.it165.net/os/html/201303/4822.html)

  • 自己测试,在sysWOW64下注册成功,如果不行,还可以去system32下注册,这次不会报错,system32下再次注册成功,就能使用了.

0 0
原创粉丝点击