简体   繁体   English

无法为JavaScript中的ActiveX控件实例化对象:出现429错误

[英]Cannot instantiate Object for ActiveX control in JavaScript: get 429 error

I created an ActiveX control (code only eg ZPLPrint.cs) that I compiled as a library into a dll using the csc command in the .Net 4.xxx directory. 我创建了一个ActiveX控件(仅代码,例如ZPLPrint.cs),并使用.Net 4.xxx目录中的csc命令将其作为库编译为dll。 Then I registered the dll using regasm ZPLPrint.dll /tlb /codebase . 然后,我使用regasm ZPLPrint.dll / tlb / codebase注册了dll。 I'm using WebMatrix to build the control and also using it to run IE10. 我正在使用WebMatrix构建控件,还使用它来运行IE10。 My OS is Windows 8. In my sitelayout.cshtml (in WebMatrix) I have the following JavaScript embedded in the head section: script type="text/javascript" var x = new ActiveXObject("ABCActiveXPrint.ZPLPrint"); 我的操作系统是Windows8。在我的sitelayout.cshtml(在WebMatrix中)中,我的头部嵌入了以下JavaScript:脚本类型=“ text / javascript” var x = new ActiveXObject(“ ABCActiveXPrint.ZPLPrint”);

There is more to the script but I can't get past creating the object above. 脚本还有更多内容,但我无法克服上面创建对象的问题。 I get the following error message: “SCRIPT429: Automation server can't create object”. 我收到以下错误消息:“ SCRIPT429:自动化服务器无法创建对象”。 This will ultimately be run on Windows Mobile 6.5 CE. 该程序最终将在Windows Mobile 6.5 CE上运行。 Am I on the right track here or should I be considering another approach? 我是在这里吗?还是应该考虑其他方法? Any help would be appreciated. 任何帮助,将不胜感激。

Apparently the browser was preventing the control from executing due to its security settings. 显然,由于其安全设置,浏览器阻止了该控件的执行。 Since I was developing locally, I simply added localhost to the list of trusted sites and was able to get past the error. 由于我是在本地开发的,因此我只需将localhost添加到受信任的站点列表中,就可以克服该错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM