469,333 Members | 4,378 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,333 developers. It's quick & easy.

How to capture ActiveX Exe event in javascript?

I know this question has been asked a million times but I still can't
get an event from an embedded ActiveX Exe to be caught in javascript.
I am able to access all the properties and methods of the ActiveX Exe,
I just can't seem to catch the event.

I've declared my object as follows:

<OBJECT
ID = "Test3"
CODEBASE = "http://www.amys-attic.com/Test3.exe"
CLASSID = "CLSID:2ACAEF35-445C-4717-8ACB-A3423E8D64EB"
style="display:none;">
</OBJECT>

My javascript event handler is as follows:

<script language="javascript" for="Test3"
event="PipeEvent(bIsPresent)">
alert("Pipe Detect");
</script>

The event handler never fires. I debugged the ActiveX Exe and verified
that the event is indeed being raised.

I am able to catch the event in a VB6 test container project as well.

Any ideas?

Jul 19 '06 #1
3 8188
Hi Chad,
<script language="javascript" for="Test3"
event="PipeEvent(bIsPresent)">
alert("Pipe Detect");
</script>

The event handler never fires. I debugged the ActiveX Exe and verified
that the event is indeed being raised.
It might be that you don't need to specify the arguments:

<script language="javascript" for="Test3" event="PipeEvent">
alert("Pipe Detect");
</script>

You can then query window.event for the properties. Note though that I
have never done this :)

Vincent
Jul 20 '06 #2
Thank you for the reply Vincent. I had already tried it without the
event parameter and the event still does not fire. We are completely
stumped since all the documentation and posts to this group show that
my implementation should work. I'm going to try and write a very
simple barebones test ActiveX exe and see if I can get it to work.

Thank you once again!
Vincent van Beveren wrote:
Hi Chad,
<script language="javascript" for="Test3"
event="PipeEvent(bIsPresent)">
alert("Pipe Detect");
</script>

The event handler never fires. I debugged the ActiveX Exe and verified
that the event is indeed being raised.

It might be that you don't need to specify the arguments:

<script language="javascript" for="Test3" event="PipeEvent">
alert("Pipe Detect");
</script>

You can then query window.event for the properties. Note though that I
have never done this :)

Vincent
Jul 20 '06 #3
VK

Chad Johnson wrote:
stumped since all the documentation and posts to this group show that
my implementation should work.
You must be reading them wrong ;-)
I'm going to try and write a very
simple barebones test ActiveX exe and see if I can get it to work.
I suggest to do so only after you study
<http://support.microsoft.com/?id=200839and re-write your ActiveX
accordingly.

The core of the problem is that you are assuming JScript events and
ActiveX events being of the same nature and being propagated in the
same container (UA). In fact they have /nothing/ in common neither in
the execution context nor in used interfaces. They have no idea of each
other unless explicetly programmed to inform each other. Think of Word
window and Excel window: if you click your mouse in the Word
application, Excel is not informed of it (unless your custom VBA takes
care of it).

Jul 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by jva02 | last post: by
4 posts views Thread by Bill Manring | last post: by
5 posts views Thread by ewillyb | last post: by
7 posts views Thread by Lit | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by haryvincent176 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.