Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

"Automation server can't create object" error with activex jscript

Options
  • 22-10-2010 11:35am
    #1
    Registered Users Posts: 3,808 ✭✭✭


    i am trying to use mscomm in html and javascript to communicate with a device over the serial port but when i run a test of the activex object in a .hta file i get the error "Automation server can't create object". does anybody know why its doing this?
    it gives the error on the line with var mscomm = new activex.........

    <OBJECT classid="clsid:648A5600-2C6E-101B-82B6-000000000014" id="MSComm1" CodeBase="mscomm32.ocx" type="application/x-oleobject" style ="display: none">
    <PARAM NAME="_ExtentX" VALUE="1005">
    <PARAM NAME="_ExtentY" VALUE="1005">
    <PARAM NAME="_Version" VALUE="393216">
    <PARAM NAME="CommPort" VALUE="1">
    <PARAM NAME="DTREnable" VALUE="1">
    <PARAM NAME="Handshaking" VALUE="0">
    <PARAM NAME="InBufferSize" VALUE="1024">
    <PARAM NAME="InputLen" VALUE="0">
    <PARAM NAME="NullDiscard" VALUE="0">
    <PARAM NAME="OutBufferSize" VALUE="512">
    <PARAM NAME="ParityReplace" VALUE="63">
    <PARAM NAME="RThreshold" VALUE="0">
    <PARAM NAME="RTSEnable" VALUE="0">
    <PARAM NAME="BaudRate" VALUE="9600">
    <PARAM NAME="ParitySetting" VALUE="0">
    <PARAM NAME="DataBits" VALUE="8">
    <PARAM NAME="StopBits" VALUE="0">
    <PARAM NAME="SThreshold" VALUE="0">
    <PARAM NAME="EOFEnable" VALUE="0">
    <PARAM NAME="InputMode" VALUE="0">
    </OBJECT>

    <script >
    var msComm1 = new ActiveXObject("MSComm1Lib.MSComm.1");
    var test = msComm1.CommPort;

    </script>

    any help is greatly appreciated


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Is mscomm32.ocx installed on the target machine?


  • Registered Users Posts: 3,808 ✭✭✭FatherLen


    yeah, and saved in the same directory as the .hta


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Hmm, it's been a while since I've worked with Activex stuff. Have you run regsvr32 against the ocx in the target folder? It might be that it's already registered in the system32 folder, or that it's not registered at all.


  • Registered Users Posts: 3,808 ✭✭✭FatherLen


    mscomm32.ocx is registered in the system32 folder but i cant find a mscomm.dll file there. i havent run regsvr32 with anything so far. . . .
    sorry but fairly new to this and not 100%


  • Registered Users Posts: 2,781 ✭✭✭amen


    get process monitor from Sys Internals/MS http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

    It might be a permission problem accessing the ocx/dll.

    This should tell you


  • Advertisement
  • Registered Users Posts: 3,808 ✭✭✭FatherLen


    i am now getting a "the control could not be created because it is not properly licensed" error. any thoughts? and thanks for the help so far....


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I dunno tbh, it's been 8 years since I worked with this stuff. I found this blog though: http://www.yes-tele.com/mscomm.html

    That should help you somewhat. You could always buy a commercial alternative but then you'd have to install it on the target machines.


  • Registered Users Posts: 3,808 ✭✭✭FatherLen


    ha yeah i have stumble across that blog on a few occasions. thanks for the help but i think i have to buy licensing to use mscomm.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Do you own a copy of Visual Studio (you'll probably need VS6 if it's still available). If you purchase a copy you'll get a dev license with all the controls.


Advertisement