IE 7 ActiveX Events and Javascript

Hello,

I am working on an ActiveX control that is hosted on a page using an OBJECT tag, like:

<OBJECT ID="objectID" WIDTH=0 HEIGHT=0
CLASSID="CLSID:XXXXXXXXXXXXXXXXXXXXX" VIEWASTEXT>
<PARAM NAME="_Version" VALUE="65535">
<PARAM NAME="_ExtentX" VALUE="0">
<PARAM NAME="_ExtentY" VALUE="0">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>

And then have a script tag with the format:

<SCRIPT LANGUAGE="JavaScript" FOR="objectID" EVENT="someEvent(random, data)">

alert("Got Event");

</SCRIPT>

This works perfectly and as expected in IE6, yet nothing happens in IE7. I have attached a debugger, and I can see the c++ code sending the event, but nothing happens.

As a side note, I have also tried calling a few of the methods that the control exposes and I get a javascript exception "[object error]".

I have tried all the Object activation tricks incase that was the issue, but that didn't seem to have any effect either.

If anyone knows how to make IE7 let the event through, I'd be happy to know it.

James



Answer this question

IE 7 ActiveX Events and Javascript

  • mehran farshadmehr

    I have the same probleme as Andy did someone find finally a workaround

  • Ryan Schwartz

    Hi Guys,

    I'm still having problems receiving ActiveX Events using Javascript in IE7.

    Did you finally find a workaround



  • programmer01

    It does say that in IE7, but the control works perfectly fine in IE6.

    Not once have I seen it break in IE6.


  • netpicker9

    Is marked safe for scripting.

    Thanks though


  • White_Horse

    Hi,

    Don't you get the 'Click to Activate this control' when you move the mouse over the control

    Workarounds...

    http://www.capitalhead.co/articles/activating-activex-controls.aspx

    This inconvenience has been around for some time now. The "Object error" errors indicate that this is the cause.

    Your IE6 version must be SP1, not SP2.

    Regards.



  • michael.e.obrien

    I think that IECUSTOMIZER are right becouse I fix my problem using this script:

    http://www.duckware.com/eolas/index.html

    A hug


  • BeaverMan

    Is your ActiveX control marked as safe for scripting If so, is the "Script ActiveX controls marked as safe for scripting" security option in IE7 set to "Enable"

    If your ActiveX control is not marked safe for scripting, you probably ought to change that =]

    However, there is a security setting for ActiveX controls not marked safe for scripting that you could change in the meantime, to see if that is the issue or if it is something else.


  • IE 7 ActiveX Events and Javascript