我创建了一个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.
任何帮助深表感谢.
谢谢.
对您的问题的简短答案是检查是否:
https://somewhere/within/you/website/my.cab
有关更详细的方法,请查看此答案.
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.
The short answer to your problem would be to check if:
https://somewhere/within/you/website/my.cab
For more detailed howto please look at this answer.
本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文