从共享文件夹运行程序的问题
我们目前正在根据提供给我们的 API 使用 .net 4.0 开发外部实用程序。
启动外部实用程序的主程序位于虚拟服务器上。因此,每个用户都通过转到网络文件夹并启动 .exe 来启动程序。
在主程序中,有一个选项可以启动外部实用程序,这些实用程序也是从网络路径启动的。
外部实用程序通过 api dll 连接到主程序。如果我没记错的话,这个dll是一个activex组件。
所有开发人员都在本地安装了主程序。这是在 .Net 中创建引用所必需的。如果安装不可用,则无法绑定引用。 对于开发人员来说,该工具是有效的。
但对于没有完整安装的最终用户来说,该工具不起作用,因为它会进入注册表并查找某些值。这些在最终用户站不可用。
最终用户在尝试启动时收到此警告
无法将类型“System.__ComObject”的 COM 对象转换为接口类型“MegaMapp.MegaCurrentEnv”。此操作失败,因为对 IID 为“{33D6C7C0-7D1B-450E-B8A4-8A8611D5B40F}”的接口的 COM 组件上的 QueryInterface 调用因以下错误而失败:不支持此类接口(HRESULT 异常:0x80004002 (E_NOINTERFACE))
{33D6C7C0-7D1B-450E-B8A4-8A8611D5B40F} 是最终用户无法使用的注册表项。
有没有办法告诉工具应该从 exe 所在的服务器而不是本地注册表加载注册表项?
We are currently in the process of developing external utilities with .net 4.0 based on an API supplied to us.
The main program, from where the external utilities are started, is located on a virtual server. So every user starts the program by going to a network folder and launching the .exe.
In the main program there is an option to start the external utilities which are the also launched from a network path.
The external utilities connect to the main program via an api dll. If I'm not mistaken, the dll is an activex component.
All developers have a local installation of the main program. This was needed to create the reference in .Net. If the install wasn't available, a reference could not be bound.
For the developers, the tool works.
But for the end-user, which don't have the full install, the tool doesn't work because it goes the registry and looks for some values. These aren't available at and end-user station.
The end-user gets this warning when trying to start
Unable to cast COM object of type 'System.__ComObject' to interface type 'MegaMapp.MegaCurrentEnv'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{33D6C7C0-7D1B-450E-B8A4-8A8611D5B40F}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))
{33D6C7C0-7D1B-450E-B8A4-8A8611D5B40F} is a registry key which isn't available to end-users.
Is there a way to tell the tools they should load the registry keys from the server where the exe resides and not from their local registry?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ActiveX 组件始终需要客户端计算机上的注册表设置。
您可以在应用程序启动期间使用 regsvr32 在使用 DLL 之前注册它。我不确定是否需要管理员权限。
我不会尝试在这样的环境中使用ActiveX。
构建一个使用 ActiveX 组件的服务器(例如 WCF 服务主机)并从每个客户端与该服务器进行通信。
ActiveX components will always need registry settings on the client machine.
you could use regsvr32 during application launch to register the DLL before you use it. I'm unsure of if administrator privileges are required.
I would not try to use ActiveX in such environment.
Build a server (for instance a WCF service host) which uses the ActiveX component and talk with that server from each client.
如果外部实用程序是 ActiveX EXE,则您可以使用标准 regsvr32 实用程序在最终用户的计算机上注册它。仅第一次需要完成此操作。
If the external utility is an ActiveX EXE, then you can register it on end-user's machines using the standard regsvr32 utility. It needs to be done for the first time only.