ActiveX控件无法注册

ActiveX Control failing to register
2021-01-20
  •  译文(汉语)
  •  原文(英语)

我创建了一个ActiveX控件,该控件将文档打印到特殊的打印机上(当然,假设用户使用的是IE).当我使用手动注册控件时,该控件运行良好regasm /codebase C:\path-to-dll.下一步是通过将以下内容插入我的网页来使其自动安装:

<object name="MyPrinter" style="display: none;" id="MyPrinter" classid="CLSID:1F668100-532A-4077-BEDE-1610AF2CC6DF" codebase="@Url.Content("~/Cabinets/MyPrinter.cab")"></object>

访问该页面后,IE会提示您安装控件.安装完成后,当我尝试使用控件时,我得到了经典的"自动化服务器无法创建对象".

我已经使用iexpress.exe创建了CAB文件..msi文件是使用InstallShield项目创建的.我正在使用Visual Studio 2013.

任何帮助深表感谢.

谢谢.

速聊1:
您必须为Active X创建一个MSI安装程序.该MSI安装程序将与一个inf文件一起封装在cab文件中,以指定提取方法
解决过程1

对您的问题的简短答案是检查是否:

  • dll使用codesign证书签名
  • 使用CodeSign证书对MSI安装程序进行签名
  • 使用codesign证书对包含msi安装程序的cab文件进行签名
  • 链接到cab文件是 https://somewhere/within/you/website/my.cab
  • 驾驶室的安装不会直接使用msiexec,而是会在驾驶室内调用某些exe

有关更详细的方法,请查看此答案.

I've created an ActiveX control which will print a document to a special printer (assuming the user is using IE, of course). The control works perfectly fine when I manually register it using regasm /codebase C:\path-to-dll. Next step is to get it to automatically install by inserting the following into my web page:

<object name="MyPrinter" style="display: none;" id="MyPrinter" classid="CLSID:1F668100-532A-4077-BEDE-1610AF2CC6DF" codebase="@Url.Content("~/Cabinets/MyPrinter.cab")"></object>

Upon visiting the page, IE does prompt to install the control. Once installed, when I attempt to use the control I get the classic "Automation server cannot create the object".

I've created the CAB file using iexpress.exe. The .msi file was created by using an InstallShield project. I'm using Visual Studio 2013.

Any help is much appreciated.

Thanks.

Talk1:
you must create an MSI installer for your Active X. the MSI installer will be encapsulated within a cab file along with an inf file to specify the extraction method
Solutions1

The short answer to your problem would be to check if:

  • dlls are signed using codesign certificate
  • msi installer is signed using codesign certificate
  • cab file containing msi installer is signed using codesign certificate
  • link to cab file is https://somewhere/within/you/website/my.cab
  • installation of the cab does not use msiexec directly but calls some exe within your cab

For more detailed howto please look at this answer.

转载于:https://stackoverflow.com/questions/25408873/activex-control-failing-to-register

本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文

留言回复
我们只提供高质量资源,素材,源码,坚持 下了就能用 原则,让客户花了钱觉得值
上班时间 : 周一至周五9:00-17:30 期待您的加入