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. Handling events fired from an ATL COM object in VBScript

2. VB event source and a ATL event sink

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

4. Sinking events from ATL object

5. Firing an Event from an ATL control, catching it in VBS in IE5

6. VB IDE with ATL DLL firing events and errors

7. Sinking COM Events in JScript

8. HowTo: Sinking Events in JScript from a COM Object

9. Sinking events for COM objects retrieved w/o CreateObject

10. Control Event Problem (Post Event after an event is fired)

11. Connecting VBScript application to ATL/COM/DLL server component

12. Late Binding Event Sinks from VB Components

 

 
Powered by phpBB® Forum Software