ATL COM Component firing events into VBScript event sink 
Author Message
 ATL COM Component firing events into VBScript event sink

Hi,

I've been pulling my hair out all day - trying to get a basic event to fire
from a ATL component into a VBScript event sink in Internet Explorer.

I have created a new ATL COM Component using the wizard, and checked the
"Support Connection Points" option.  I've then added a method to the
xxxxEvents interface that it creates (This will be the event).

I've then rebuilt the project (to generate the TLB) and gone to the
Implement Connection points dialog and a proxy class has been created,
complete with the Fire_xxxx method.

I've then created a method on the main Interface that calls this Fire_xxxx
method.  When I call this method from Visual Basic the event fires fine,
whilst in VBScript it doesn't.  I've added tracing to the Fire_xxx method
and it get's called but there are no connections registered so the event is
never fired.

I've also added the implementation for IProvideClassInfo by using the
IProvideClassInfo2Impl template.
See ( Q200839 - HOWTO: Enable ActiveX Control Event Handling on a Web Page )

And yet it still doesn't work in VBScript within IE!!! - Anyone got any
ideas, I've trawled the normal sources but to no avail!

The VBScript source is included at the end of the message...

Thanks in advance - Can you  copy any replies to my email as well as here
please?

Regards,

Darren

<html>
<head>
</head>
<body>
<object id=events classid=CLSID:CC872497-2D2B-4812-BEFD-CE4E30E80A07
width="14" height="14"></object>

<script language="VBScript">
Sub events_AnEvent
msgbox "Got Event"
End Sub
</script>

<script language="VBScript">
events.DoIt
</script>

</body>
</html>

--

Darren Jefford



Sun, 19 Oct 2003 03:58:03 GMT  
 ATL COM Component firing events into VBScript event sink
Hi,

I've been pulling my hair out all day - trying to get a basic event to fire
from a ATL component into a VBScript event sink in Internet Explorer.

I have created a new ATL COM Component using the wizard, and checked the
"Support Connection Points" option.  I've then added a method to the
xxxxEvents interface that it creates (This will be the event).

I've then rebuilt the project (to generate the TLB) and gone to the
Implement Connection points dialog and a proxy class has been created,
complete with the Fire_xxxx method.

I've then created a method on the main Interface that calls this Fire_xxxx
method.  When I call this method from Visual Basic the event fires fine,
whilst in VBScript it doesn't.  I've added tracing to the Fire_xxx method
and it get's called but there are no connections registered so the event is
never fired.

I've also added the implementation for IProvideClassInfo by using the
IProvideClassInfo2Impl template.
See ( Q200839 - HOWTO: Enable ActiveX Control Event Handling on a Web Page )

And yet it still doesn't work in VBScript within IE!!! - Anyone got any
ideas, I've trawled the normal sources but to no avail!

The VBScript source is included at the end of the message...

Thanks in advance - Can you  copy any replies to my email as well as here
please?

Regards,

Darren

<html>
<head>
</head>
<body>
<object id=events classid=CLSID:CC872497-2D2B-4812-BEFD-CE4E30E80A07
width="14" height="14"></object>

<script language="VBScript">
Sub events_AnEvent
msgbox "Got Event"
End Sub
</script>

<script language="VBScript">
events.DoIt
</script>

</body>
</html>

--

Darren Jefford



Sun, 19 Oct 2003 03:57:43 GMT  
 ATL COM Component firing events into VBScript event sink
Hi,

I've been pulling my hair out all day - trying to get a basic event to fire
from a ATL component into a VBScript event sink in Internet Explorer.

I have created a new ATL COM Component using the wizard, and checked the
"Support Connection Points" option.  I've then added a method to the
xxxxEvents interface that it creates (This will be the event).

I've then rebuilt the project (to generate the TLB) and gone to the
Implement Connection points dialog and a proxy class has been created,
complete with the Fire_xxxx method.

I've then created a method on the main Interface that calls this Fire_xxxx
method.  When I call this method from Visual Basic the event fires fine,
whilst in VBScript it doesn't.  I've added tracing to the Fire_xxx method
and it get's called but there are no connections registered so the event is
never fired.

I've also added the implementation for IProvideClassInfo by using the
IProvideClassInfo2Impl template.
See ( Q200839 - HOWTO: Enable ActiveX Control Event Handling on a Web Page )

And yet it still doesn't work in VBScript within IE!!! - Anyone got any
ideas, I've trawled the normal sources but to no avail!

The VBScript source is included at the end of the message...

Thanks in advance - Can you  copy any replies to my email as well as here
please?

Regards,

Darren

<html>
<head>
</head>
<body>
<object id=events classid=CLSID:CC872497-2D2B-4812-BEFD-CE4E30E80A07
width="14" height="14"></object>

<script language="VBScript">
Sub events_AnEvent
msgbox "Got Event"
End Sub
</script>

<script language="VBScript">
events.DoIt
</script>

</body>
</html>

--

Darren Jefford



Sun, 19 Oct 2003 03:58:25 GMT  
 ATL COM Component firing events into VBScript event sink
Simple - the script engine hasn't attached the sink when your code
executes. Try doing it later (from a hyperlink for example).

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> Hi,

> I've been pulling my hair out all day - trying to get a basic event to
fire
> from a ATL component into a VBScript event sink in Internet Explorer.

> I have created a new ATL COM Component using the wizard, and checked the
> "Support Connection Points" option.  I've then added a method to the
> xxxxEvents interface that it creates (This will be the event).

> I've then rebuilt the project (to generate the TLB) and gone to the
> Implement Connection points dialog and a proxy class has been created,
> complete with the Fire_xxxx method.

> I've then created a method on the main Interface that calls this Fire_xxxx
> method.  When I call this method from Visual Basic the event fires fine,
> whilst in VBScript it doesn't.  I've added tracing to the Fire_xxx method
> and it get's called but there are no connections registered so the event
is
> never fired.

> I've also added the implementation for IProvideClassInfo by using the
> IProvideClassInfo2Impl template.
> See ( Q200839 - HOWTO: Enable ActiveX Control Event Handling on a Web
Page )

> And yet it still doesn't work in VBScript within IE!!! - Anyone got any
> ideas, I've trawled the normal sources but to no avail!

> The VBScript source is included at the end of the message...

> Thanks in advance - Can you  copy any replies to my email as well as here
> please?

> Regards,

> Darren

> <html>
> <head>
> </head>
> <body>
> <object id=events classid=CLSID:CC872497-2D2B-4812-BEFD-CE4E30E80A07
> width="14" height="14"></object>

> <script language="VBScript">
> Sub events_AnEvent
> msgbox "Got Event"
> End Sub
> </script>

> <script language="VBScript">
> events.DoIt
> </script>

> </body>
> </html>

> --

> Darren Jefford




Sun, 19 Oct 2003 04:17:55 GMT  
 ATL COM Component firing events into VBScript event sink
Hello Darren,

How about such code? It should work:

<script language="VBScript" for="events" event="AnEvent">
    msgbox "Got Event"
</script>

--
Best regards,
Vadim Melnik,
{*filter*} Consultant.
_____________________________
http://www.*-*-*.com/


Quote:
> Hi,

> I've been pulling my hair out all day - trying to get a basic event to
fire
> from a ATL component into a VBScript event sink in Internet Explorer.

> I have created a new ATL COM Component using the wizard, and checked the
> "Support Connection Points" option.  I've then added a method to the
> xxxxEvents interface that it creates (This will be the event).

> I've then rebuilt the project (to generate the TLB) and gone to the
> Implement Connection points dialog and a proxy class has been created,
> complete with the Fire_xxxx method.

> I've then created a method on the main Interface that calls this Fire_xxxx
> method.  When I call this method from Visual Basic the event fires fine,
> whilst in VBScript it doesn't.  I've added tracing to the Fire_xxx method
> and it get's called but there are no connections registered so the event
is
> never fired.

> I've also added the implementation for IProvideClassInfo by using the
> IProvideClassInfo2Impl template.
> See ( Q200839 - HOWTO: Enable ActiveX Control Event Handling on a Web
Page )

> And yet it still doesn't work in VBScript within IE!!! - Anyone got any
> ideas, I've trawled the normal sources but to no avail!

> The VBScript source is included at the end of the message...

> Thanks in advance - Can you  copy any replies to my email as well as here
> please?

> Regards,

> Darren

> <html>
> <head>
> </head>
> <body>
> <object id=events classid=CLSID:CC872497-2D2B-4812-BEFD-CE4E30E80A07
> width="14" height="14"></object>

> <script language="VBScript">
> Sub events_AnEvent
> msgbox "Got Event"
> End Sub
> </script>

> <script language="VBScript">
> events.DoIt
> </script>

> </body>
> </html>

> --

> Darren Jefford




Tue, 21 Oct 2003 22:31:55 GMT  
 ATL COM Component firing events into VBScript event sink
pls forget my poor english.

you can do it follow below:

<script language="VBScript">
test.events.DoIt
</script>

<FORM name=test>
<OBJECT ID="events" CLASSID="CLSID:814B6C1B-86B7-465B-A783-8B979BDED347">
</OBJECT>
<SCRIPT FOR="events" EVENT="AnEvent" LANGUAGE="VBScript">
      msgbox "Got Event"
</SCRIPT>
</FORM>

I have test it ,and it really worked.

Quote:
----- Original Message -----

Newsgroups:
microsoft.public.vc.atl,microsoft.public.scripting.vbscript,microsoft.public
.inetexplorer.scripting
Sent: Wednesday, May 02, 2001 3:58 AM
Subject: ATL COM Component firing events into VBScript event sink

> Hi,

> I've been pulling my hair out all day - trying to get a basic event to
fire
> from a ATL component into a VBScript event sink in Internet Explorer.

> I have created a new ATL COM Component using the wizard, and checked the
> "Support Connection Points" option.  I've then added a method to the
> xxxxEvents interface that it creates (This will be the event).

> I've then rebuilt the project (to generate the TLB) and gone to the
> Implement Connection points dialog and a proxy class has been created,
> complete with the Fire_xxxx method.

> I've then created a method on the main Interface that calls this Fire_xxxx
> method.  When I call this method from Visual Basic the event fires fine,
> whilst in VBScript it doesn't.  I've added tracing to the Fire_xxx method
> and it get's called but there are no connections registered so the event
is
> never fired.

> I've also added the implementation for IProvideClassInfo by using the
> IProvideClassInfo2Impl template.
> See ( Q200839 - HOWTO: Enable ActiveX Control Event Handling on a Web
Page )

> And yet it still doesn't work in VBScript within IE!!! - Anyone got any
> ideas, I've trawled the normal sources but to no avail!

> The VBScript source is included at the end of the message...

> Thanks in advance - Can you  copy any replies to my email as well as here
> please?

> Regards,

> Darren

> <html>
> <head>
> </head>
> <body>
> <object id=events classid=CLSID:CC872497-2D2B-4812-BEFD-CE4E30E80A07
> width="14" height="14"></object>

> <script language="VBScript">
> Sub events_AnEvent
> msgbox "Got Event"
> End Sub
> </script>

> <script language="VBScript">
> events.DoIt
> </script>

> </body>
> </html>

> --

> Darren Jefford




Sun, 15 Feb 2004 13:09:20 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Fire an Event, sink a event - Help!

2. creating a sink in VC to handle events fired by VB Com Object

3. ATL DLL event sink with a VB ActiveX DLL event source

4. Event Sink for a COM object which raises events - Proof of Concept

5. COM client (MFC) using ATL to sink events ?

6. Event source and sink for COM without ATL or MFC

7. cegadgets.com ATL CE event firing

8. ATL COM object pointer and fire events

9. Fire event with ByRef param from ATL COM ?!

10. Connection Points - firing an event to a sink in another process

11. Problem with ATL Sink class for catching another ATL's events

12. How to event sink to events in the same IDispatch derived class

 

 
Powered by phpBB® Forum Software