[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

How to download an ActiveX automatically and register it into the system?

This is a script file written to test the IETimer.ocx

<HTML>

<HEAD><TITLE>Timer Function </TITLE></HEAD>

<BODY onload="StartTimer();">
Timer Function
<object id="timer1"
classid="clsid:59CCB4A0-727D-11CF-AC36-00AA00A47DD2">
<param name="Interval" value="2000"><param
name="Enabled" value="false"></object>
<SCRIPT LANGUAGE="JavaScript" FOR="timer1" EVENT="Timer()">
<!--
    Timer1_timer()
-->
</SCRIPT>

<script langugae="JavaScript">
<!--
function StartTimer()
{
      timer1.Enabled = true
      
}
var nCount = 0
function Timer1_timer()
{
      nCount++;
      document.test.count.value = nCount;
      
}
//-->
</script>

Test Page
<br>
<form name=test >
<input type=text name=count value=0>
</form>

</BODY>
</HTML>


When this is executed in WinNT IE4.0 the ocx was automatically downloaded from the internet and the timer started working.  When the same was executed on Win 95 it did not work.  I got a script error while accessing the property of the timer which means the control was not registered properly.  The same thing happens for WinNT IE 3.0 browsers.  What is the reason?  Is there any way by which it can be downloaded and registered automatically?  What are all the steps needed for this?
0
crv
Asked:
crv
1 Solution
 
percynCommented:
The <object> tag WILL instantiate the control if already installed. If it is not installed, you need to use the CODEBASE tag to point to the control, so that the browser can download and register it.

<OBJECT ID="Menu1" WIDTH=0 HEIGHT=0
CLASSID="CLSID:F5131C24-E56D-11CF-B78A-444553540000"
CODEBASE="#version=1,0,0,9">
...
...
</Object>
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now