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. Web Development
  3. ASP.NET
  4. Auto-Register ActiveX object client side

Auto-Register ActiveX object client side

Scheduled Pinned Locked Moved ASP.NET
comquestionjavascriptsysadminhelp
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.
  • B Offline
    B Offline
    bigmacrox
    wrote on last edited by
    #1

    I have an activex object, testObject.dll, under my website. I instantiate the activex object under javascript like so: "var obj = new ActiveXObject("testObjectNameSpace.testObjectClass");". But the only way this will work is if I register the .dll on the local machine otherwise I get this error: "automation server can't create object". I tried putting in the tag with classid and everything, but then I get a "object not defined" error when I run the javascript (i.e, if the object has id "objectTest" and one of the methods in the activex object is displayRandomText, I get the error on the javascript: "objectTest.displayRandomText();"). How can I make it so the client can automatically register the activex object without having to do it manually using the regasm command (i.e. regasm testObject.dll /tlb:testObjectNet.dll /codebase)?

    R 1 Reply Last reply
    0
    • B bigmacrox

      I have an activex object, testObject.dll, under my website. I instantiate the activex object under javascript like so: "var obj = new ActiveXObject("testObjectNameSpace.testObjectClass");". But the only way this will work is if I register the .dll on the local machine otherwise I get this error: "automation server can't create object". I tried putting in the tag with classid and everything, but then I get a "object not defined" error when I run the javascript (i.e, if the object has id "objectTest" and one of the methods in the activex object is displayRandomText, I get the error on the javascript: "objectTest.displayRandomText();"). How can I make it so the client can automatically register the activex object without having to do it manually using the regasm command (i.e. regasm testObject.dll /tlb:testObjectNet.dll /codebase)?

      R Offline
      R Offline
      RichardGrimmer
      wrote on last edited by
      #2

      The reason that it's not creating the object is cos COM (ActiveX) uses the registry to map class IDs to filenames. When you register a component, the mapping is added into the registry under HKEY_CLASSES_ROOT. Without the registration, the COM subsystem doesn't know where to find the dll that you want - doesn't matter if you give it a classid or a progid. If I remember correctly (and HIGH probability that I don't!) can specify a filename rather that a progid / clsid to CoCreateInstance...maybe someone more knowledgable could shed some light? May be possible to do something similar in *.js? "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

      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