Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Handling COM Events from script

Handling COM Events from script

Scheduled Pinned Locked Moved COM
comquestionhtmltoolstutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gerald Schwab
    wrote on last edited by
    #1

    If I have a component, that's not an activeX control, that implements connection points, how do I recieve the events from script? I'd like to do something like the following :

    Dim obj
    Set obj = CreateObject("XYZ.SomeObject")

    Sub ISomeObject_OnSomethingHappened()
    'Event was fired, handle it...
    End Sub

    Another example is MSXML. The MSXML DOM implements events that can be handled from script. How is this done?

    var xmldoc;
    function Load()
    {
    xmldoc = new ActiveXObject("MSXML2.DOMDocument.4.0");
    xmldoc.onreadystatechange = CheckState; <<-- How do I implement this functionality in my component???
    xmldoc.load(URL.value);
    }
    function CheckState()
    {
    // Handle readystatechange events..
    }

    Thanks....

    L 1 Reply Last reply
    0
    • G Gerald Schwab

      If I have a component, that's not an activeX control, that implements connection points, how do I recieve the events from script? I'd like to do something like the following :

      Dim obj
      Set obj = CreateObject("XYZ.SomeObject")

      Sub ISomeObject_OnSomethingHappened()
      'Event was fired, handle it...
      End Sub

      Another example is MSXML. The MSXML DOM implements events that can be handled from script. How is this done?

      var xmldoc;
      function Load()
      {
      xmldoc = new ActiveXObject("MSXML2.DOMDocument.4.0");
      xmldoc.onreadystatechange = CheckState; <<-- How do I implement this functionality in my component???
      xmldoc.load(URL.value);
      }
      function CheckState()
      {
      // Handle readystatechange events..
      }

      Thanks....

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This is a problem I'm having that is along similar lines to Gerald, I'm trying to use events that are implemented in a com server I created, using JavaScript. I have already implemented a Visual Basic application that works fine with it, and handles the events from the server, so I am confident that the server works fine. I have also implemented HTML and JavaScript that connects to the sever throught the tags, and it can call functions, and use properties from it, but I can't get it to handle the events from it using tags. Does anyone know if there is there anything specific I have to implement in the Server, or the JavaScript to make this work? Cheers, Dave.</x-turndown>

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups