Click to See Complete Forum and Search --> : JavaScript doesn't capture OCX events - problem


yaniv_av
July 18th, 2007, 10:01 AM
Hi,

I developed some simple OCX with one function (Func1) that fire an event (OnFunc1) through the standart ConnecionPoints.

When I tested it eith VB, the client captured the event and it was OK.
When I tested it eith IE7, the javascript didn't captured the event. and I don't know what is the problem ...

the JS code:

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>

<object CLASSID='clsid:62060B0D-1A78-4E53-9FBB-82E38BA59FAD' id='TmpOcx_TempCtl' name='TmpOcx_TempCtl' style='position:absolute;bottom:0pxright:0px;' width='1'>
</object>

<SCRIPT LANGUAGE="JavaScript" FOR="TmpOcx_TempCtl" EVENT="OnFunc1(str)">
window.alert('Kermit the frog');
</SCRIPT>


</HEAD>
<BODY>
<script language="JavaScript">
window.alert('temp');
TmpOcx_TempCtl.Func1();
</script>
<P>&nbsp;</P>

</BODY>
</HTML>



Does someone has an idea ??

PeejAvery
July 18th, 2007, 10:41 AM
Well, I am a Mac user, so I can't duplicate your situation. I would suggest altering the security settings in Internet Explorer.

Tools => Internet Options => Security

You might have to alter both the Internet and Local intranet settings depending on from where you are calling this object.

yaniv_av
July 18th, 2007, 11:28 AM
Well, I am a Mac user, so I can't duplicate your situation. I would suggest altering the security settings in Internet Explorer.

Tools => Internet Options => Security

You might have to alter both the Internet and Local intranet settings depending on from where you are calling this object.

It doesn't helped... :(

PeejAvery
July 18th, 2007, 11:42 AM
Are you running this from the localhost? Or how?

yaniv_av
July 18th, 2007, 11:47 AM
Are you running this from the localhost? Or how?

Yes + I'm an admin.

By the way, I have found that if I create the COM as an ATL control - it work.
It doesn't work if I create it as ATL Simple object...