简体   繁体   English

Javascript调用Activex上的公共函数

[英]Javascript call Public function on Activex

I´m trying to call a function from javascript to ActiveX. 我正在尝试从javascript调用函数到ActiveX。 It worked but now, i have to update the activeX because of Internet Explorer 8 and Windows 7. 它起作用了,但是现在,由于Internet Explorer 8和Windows 7,我不得不更新activeX。

But for now, i can´t call the function. 但是现在,我无法调用该函数。 When i try, i got a message: Object is not a collection. 当我尝试时,我收到一条消息:对象不是集合。

What i suppose to do? 我该怎么办?

Here´s the piece of code: 这是一段代码:

Public Function Text(strTxt As String) As String
    If result Then
        Text = "Authenticated"
    Else
        Text = "Not authenticated"
    End If
End Function 

In Javascript: 用Javascript:

function leDado()
    {
        try { 
            var x=document.getElementById("MyActivex")
            document.MainForm.resultado.value = x.Text("Test string")
            x = 0;
        } 
        catch(e) { 
            alert(e.message); 
        }
    }

In the form, when i press the button, i call that function. 在表单中,当我按下按钮时,我会调用该函数。 Can anyone help me? 谁能帮我?

So you've updated the ActiveX object; 因此,您已经更新了ActiveX对象; did that break binary compatibility? 破坏了二进制兼容性吗? If so, did you unregister and re-register the library before testing it? 如果是这样,您是否在测试库之前注销并重新注册了库? Can you debug the object 'live'? 您可以调试“实时”对象吗?

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

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