Duckware
 You are here: Duckware » Activating ActiveX Controls   Contact us  
A Simpler way to Activate ActiveX controls

In April 2008, an update to IE removed the need to 'activate' ActiveX controls. If your customers are current with installing MS security updates (for IE), this workaround is no longer needed.

Activating message box
Due to the whole messy patent dispute between Microsoft and Eolas about ActiveX within web pages, Microsoft has finally changed (as of April 11, 2006) how users interact with APPLET, EMBED, or OBJECT elements on web pages, requiring an extra click to activate controls.

For interactive controls, your users will see a nasty "Click to activate and use this control" message.

This affects Adobe Reader, Apple QuickTime, Macromedia Flash, Windows Media Player, Real Networks RealPlayer, Sun Java Plugin, and others which are all implemented as ActiveX controls.

Microsoft has published a white paper "Activating ActiveX Controls" on how to change your web pages to work around the extra click (and working around the Eolas patent). However, Microsoft's example workarounds involve too many HTML changes. They want all of your APPLET, EMBED, or OBJECT elements moved into external script files.

A Simpler Way: If you read between the lines of the Microsoft white paper, there is much easier workaround. Simply wrap the offending HTML lines in a call to a function in an external JavaScript file, which then performs a document.writeln(). Namely, with an original HTML file like this (APPLET tag is used as an example, but applies to EMBED and OBJECT as well):
// original HTML file
<html><head>...</head><body>
  <applet code="pmvr.class" width=500 height=400>
  <param name="image" value="pano.jpg">
  </applet>
</body></html>
Implement the fix by wrapping the offending HTML lines like this:
// fixed HTML file
<html><head>
<script type="text/javascript" src="myprintln.js"></script>
</head><body>
  <script>
  myprintln('
<applet code="pmvr.class" width=500 height=400>');
  myprintln('
<param name="image" value="pano.jpg">');
  myprintln('
</applet>');
  </script>
</body></html>
where myprintln.js is a very simple single line external JavaScript file:
// myprintln.js
function myprintln(s) { document.writeln(s); }
This fix works because the offending HTML is still being added from an external script file (like Microsoft wants). However, don't move HTML into the script file, keep that in the HTML file.

This fix is much simpler because now there is a single unchanging JavaScript file, myprintln.js, for your entire web site, and all the offending HTML code is simply wrapped instead of changed or moved.

This simpler fix has been tested and verified to work against Microsoft's Update for Windows XP (KB912945) and the Microsoft Security Bulletin MS06-013 using Internet Explorer 6.0 and 7, Netscape 7.2, and Firefox 1.5.

Copyright © 2000-2024 Duckware