External Javascript to activate activex control

P

punchbag

Hi all,

There has recently been a new update to internet explorer whereby
activex controls now load on a page unactivated. MSDN have a website
explaining a workaround where you do away with the <OBJECT> tag in your
html and instead use an external Javascript the control will load
activated.

http://msdn.microsoft.com/library/?url=/workshop/author/dhtml/overview/activating_activex.asp

My old way of doing things was:

<TITLE>ProductOne</TITLE>
<META NAME = "System" Content="Test">
</HEAD>
<BODY>

<OBJECT ID="UserControl1"
CLASSID="CLSID:7F944D2D-D2FA-4EB7-A214-F2B6482FCD1C"
CODEBASE="TheCabFile.CAB#version=9,5,1,0">
</OBJECT>
</BODY>
</HTML>

Now i've tried to create my object using an external js like follows

//html file
<html>
<body>
<div id="DivID">
<script src="createElementExplicit.js"></script>
</body>
</html>

//js file
var myObject = document.createElement('object');
DivID.appendChild(myObject);
myObject.width = "500";
myObject.height = "300";
myObject.classid= "clsid:7F944D2D-D2FA-4EB7-A214-F2B6482FCD1C";
myObject.codebase =
"http://IPAddress/dir1/TheCabFile.cab#version=9,5,1,0";
myObject.uiMode = "none" ;


I cannot get this to work. If the user has the old control on their
machine it works fine and gets around this new problem of activating
the component. But where its a new installation, it does not download
the cab and install the control. Can any of you JavaScript/ActiveX
guru's help me out on this one? I feel that my js is wrong. Like can i
use myobject.codebase, i;m really trying to improvise the code on the
msdn website here to no avail so any help would be greatly appreciated,

Thanks

Bren
 
P

punchbag

Hi thanks for your reply. In the article in question they talk about
activating the control by tabbing onto it for instance. In a way its a
means of setting focus on the control. The actual installation of the
control i don't want to force (I'm not writing a virus here ;) ), more
that Im interested that when the control loads it will have focus.

I've managed to do this in the case where the user has previously
downloaded the control (before the update). But if the user hasn't
there seems to be something wrong with my codebase definition, as the
page loads and it never prompts me as to whether i would like to
install the activex control. I.e it doesnt download the cab. A blank
page simply loads. Could you hazard a further guess as to what is wrong
with my javascript. I tried your previous suggestion, however it failed
to work.

Bren
 
P

punchbag

Yea there is definitely not an issue with the signing. After i make the
cab, it is signed, plus the fact that this worked perfectly prior to
this IE update. Ok, i'll bring this to an active x group, thanks for
your time though
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top