locked
javascript code can not use .NET ActiveX Control RRS feed

  • Question

  • This question troubled me for a long time.

    I create my activeX control within .NET and I can find my control in ole/com viewer

    Use ActiveXObject() is working fine when I call the ActiveX method,but  ActiveXObject() seems not support ActiveX's Event.

    So,I try to package my ActiveX control to CAB. use following code replace ActiveXObject(),but it's failed (objects don't have methods)

    by the way,CAB is install successful, I can find GUID in HKEY_CLASSES_ROOT.

    this is my code in html page

    <object classid="CLSID:84D50DE0-C867-11CF-B1AE-00AA00A3F2C3" id="X"  CODEBASE="MyControl.CAB#version=1,1,0,0"></object>

    function Test() {
        try {
            var rtn;      
            rtn = document.X.Hello("hello");
        }
        catch (e) {
            alert('error:' + e);
        }
    }

    Is anyone know why it allways say objects don't have methods

    thanks in advance.

    Thursday, October 12, 2017 8:47 AM

Answers