开发者

Javascript Refuses to Call ActiveX Method, Agrees to Call Another

开发者 https://www.devze.com 2022-12-22 01:27 出处:网络
I have an ActiveX object which extends some functions. I have a web page that loads the ActiveX object and calls its methods in Javascript. The ActiveX object has two method; the problem is that Javas

I have an ActiveX object which extends some functions. I have a web page that loads the ActiveX object and calls its methods in Javascript. The ActiveX object has two method; the problem is that Javascript can successfully call one of them but fails to call the other; citing Object doesn't support this property or method which is nonsense because I made a VB6.0 application that successfully calls 开发者_Go百科this other method, so the two functions are indeed extended correctly and performing their job.

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.

Any idea why Javascript is being a headcase?


The answer was pretty simple. In the IDL file the function was declared as a property (propget) without taking any input arguments. In the Javascript code, I was calling actvx3obj.ATR(); when in fact I should have been calling actvx3obj.ATR; because it is a property get method that takes no argument.

I'm posting this in the hopes that someone with a similar problem may stumble upon the solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消