How to capture ActiveX Exe event in javascript?

C

Chad Johnson

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?
 
V

Vincent van Beveren

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
 
C

Chad Johnson

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!
 
V

VK

Chad said:
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=200839> and 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).
 

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

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top