Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.
« »

Using ActiveX controls with the latest MSIE patch

Blogged by Björn Meyer on April 12, 2006 and tagged with ActiveX, Internet Explorer.

In the last few weeks, there have been several articles, claiming that the latest Mircosoft patch for the Internet Explorer (released yesterday) will 'break' complete web pages and that Microsoft is going to say good bye to the ActiveX technology. One sentence in MSDN makes many people listen attentively:

"Users cannot directly interact with Microsoft ActiveX controls loaded by the APPLET, EMBED, or OBJECT elements."

Well, the situation is not that serious.

It is correct that controls will be displayed in an 'inactive' mode so that the user cannot interact with them until they click on the control and confirm the activation by clicking 'OK' in a prompt. This is also valid for Flash animations or Quicktime movies, not only ActiveX controls, such as TX Text Control ActiveX.

The normal way to integrate TX Text Control ActiveX into an HTML page is the following using the OBJECT tag:

<html>
 <body>
   <object
      classid="clsid:ab949ac1-ec97-11d9-9e2b-004005a9abd2"
      id=objTX
      width=600
      height=400
     >
    </object>
 </body>
</html>

In this case, TX Text Control is made inactivate on startup and must be activated by clicking on the control. The following screenshot shows the tooltip that is displayed by Internet Explorer with the latest patch.

Screenshot

To avoid this activation, you can use Javascript to replace a DIV tag after the page has been loaded. By doing this, the ActiveX control must not be activated by the user.

<html>
 <head>
   <script src="script.js" language="JScript"></script>
 </head>
 
 <body>
   <div id="objTX">
      This DIV will be replaced with TX Text Control
   </div>
   <script language="JScript">
     CreateControl( "objTX",
                    "clsid:ab949ac1-ec97-11d9-9e2b-004005a9abd2",
                    "ObjTX", "600", "400")
   </script>
 </body>
</html>
function CreateControl(DivID, CLSID, ObjectID, WIDTH, HEIGHT)
{
    var d = document.getElementById(DivID);
    d.innerHTML = '<object classid=' + CLSID + ' id=' + ObjectID + ' width=' + WIDTH + ' height=' + HEIGHT +'>';
}

This brings us to the reason why this patch changes the handling of ActiveX controls: It is not a security issue, but a patent dispute between Microsoft and a company called Eolas.

With this little trick, web projects that deploy TX Text Control ActiveX work as before.

« Prev:Does TX Text Control fit my requirements?
» Next:Getting the input position from the mouse position

top

Top 10 Bestselling Product Award 2007Top 25 Publisher Product Award 2007Top 10 Bestselling Product Award 2007 in JapanTop 25 Bestselling Product Award 2006Top 25 Bestselling Publisher Award 2006Reader's Choice Award, dot.net magazin, 3rd place