Dave's Brain

Browse - programming tips - use activex in internet explorer

Date: 2009jul8

Q.  How do I use a COM object (.OCX file) aka ActiveX in Internet Explorer?

A.  Use <object> with your class id.

<script>
var	gObj;

function init() {
	gObj = document.getElementById('myocx');
	gObj.MyMethod1();
}
</script>

<body onload="init()">

<object classid="clsid:00000000-0000-0000-0000-000000000000" id="myocx" width="200" height="200">
</object>

<button onClick="gObj.MyMethod2()">MyMethod2</button>

</body>

This does *not* work in Firefox or other browsers.
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: