简体   繁体   English

Javascript拒绝调用ActiveX方法,同意调用另一个

[英]Javascript Refuses to Call ActiveX Method, Agrees to Call Another

I have an ActiveX object which extends some functions. 我有一个扩展了某些功能的ActiveX对象。 I have a web page that loads the ActiveX object and calls its methods in Javascript. 我有一个网页,可加载ActiveX对象并使用Javascript调用其方法。 The ActiveX object has two method; ActiveX对象有两种方法: the problem is that Javascript can successfully call one of them but fails to call the other; 问题是Javascript可以成功调用其中之一,而不能调用另一个; citing Object doesn't support this property or method which is nonsense because I made a VB6.0 application that successfully calls this other method, so the two functions are indeed extended correctly and performing their job. 引用Object不支持该属性或方法 ,这是胡说八道,因为我制作了一个VB6.0应用程序,该应用程序成功调用了另一个方法,因此这两个函数确实可以正确扩展并执行其工作。

And yes, the Internet Explorer security zones are all set and everything, as I wrote above the javascript code can call one method but refuses to call the other. 是的,正如我在javascript代码上面所写的那样,Internet Explorer安全区域已全部设置,并且可以进行所有操作,但是可以调用一种方法,但拒绝调用另一种方法。

Any idea why Javascript is being a headcase? 知道为什么Javascript成为头条新闻吗?

The answer was pretty simple. 答案很简单。 In the IDL file the function was declared as a property (propget) without taking any input arguments. 在IDL文件中,该函数被声明为属性(属性),而没有任何输入参数。 In the Javascript code, I was calling actvx3obj.ATR(); 在Javascript代码中,我正在调用actvx3obj.ATR(); when in fact I should have been calling actvx3obj.ATR; 实际上我本应该打电话给actvx3obj.ATR的时候; because it is a property get method that takes no argument. 因为它是一个不带参数的属性get方法。

I'm posting this in the hopes that someone with a similar problem may stumble upon the solution. 我发布此消息是希望有类似问题的人可能会偶然发现该解决方案。

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

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