How to manage Activex events in JS without Object tag

Hi im developing activex control to manage webcam in IE, everything works but i need to refresh the image when a new frame is captures, up to now i display images on click, but i want to listen "Captured frame event" in JS to refresh my html view.

I have seen a lot of samples but all of these are using Object tag in html

<object id="Control" classid="CLSID:id"/>
    <script for="Control" event="myEvent()">
        alert("hello");
    </script>

is there a way to listen activex events using pure JS? using :

Ob = new ActivexObject('PROG.ID');

1 thought on “How to manage Activex events in JS without Object tag”

  1. No, it’s not working in purly JavaScript you can only use JScript.
    JScript only works in Internet Explorer and there it only works, if the user confirms to execute the scripts, ussualy you use it in an .hta Hyper Text (Markup Language) Application
    Example:

    <script language="JScript">
        "use strict";
        function openFile(strFileName) {
            var fso = new ActiveXObject("Scripting.FileSystemObject");
            var f = fso.OpenTextFile(strFileName, 1);
            if (f.AtEndOfStream) {
                return;
            }
            var file = f.ReadAll();
            f.close();
            return file;
        }
        
        function writeFile(filename, content) {
            var fso = new ActiveXObject("Scripting.FileSystemObject");
            var f = fso.OpenTextFile(filename, 2, true);
            f.Write(content);
            f.Close();
        }
    </script>
    <script language="javascript">
        "use strict";
        var native_db;
        function init() {
            var file = openFile("./Natives.json");      
            native_db = JSON.parse(file);
            displayNamespaces();
        };
        
    
    Reply

Leave a Comment