gpt4 book ai didi

c# - 在 Windows 7(64 位)中注册 COM 对象

转载 作者:行者123 更新时间:2023-11-30 16:31:44 24 4
gpt4 key购买 nike

当我在创建 COM 对象时运行 VBScript 时,我似乎遇到了问题,但仅限于 Windows 7。

当您运行 VBA 脚本时,您将获得:

Script: C:\Program Files\...
Line: 2
Char: 1
Error: ActiveX Component can't create object: 'my object'
Code: 800A01AD
Source: Microsoft VBScript runtime error

我已经使用命令提示符 (Admin) 向 regsvr32 注册了 dll,但是当它运行时我得到了另一个错误:

The module "my dll" was loaded but the entry-point DLLRegisterServer was not found.
Make sure that "my dll" is a valid DLL or OCX file and then try again

我目前运行的是 Windows 7 64 位。该脚本在 Windows XP 计算机上运行,​​但我不知道 Windows Vista 计算机(没有可测试的计算机)。我使用 OLE-COM Object Viewer 查看它是否已注册,但未显示该文件。

这是 Windows 7 或 64 位计算机或两者兼而有之的问题。

最佳答案

尝试使用 %windir%\syswow64\regsvr32 注册您的组件并使用 %windir%\syswow64\cscript.exe 运行您的 vbs 文件

您的 COM 组件可能是 32 位的,因此您需要在 64 位 Windows 上使用 32 位工具才能使其正常工作。

谢谢,标记

关于c# - 在 Windows 7(64 位)中注册 COM 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4716425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com