Home All Groups Group Topic Archive Search About

VB6 don't see events of the implemented interface

Author
22 May 2005 1:38 PM
Essam Salah
Dear All

I have an interface class like Interface_1 with event and methods like
event1,event2 , M1() , M2

If I implemet this interface in other calss like myClass  ; I can implement
the mothods M1() , M2() only but cannot raise the events  event1,event2

Any advice ..

*****************************************************************
**************************check code below ************************
*****************************************************************
' ----------------------------
Interface_1.cls
'-----------------------------

Public Event event1()
Public Event event2()

Public Function M1()

End Function


Public Function M2()

End Function
'-----------------------------------------------
MyClass.cls
'-----------------------------------------------
Option Explicit

Implements Interface_1

Private Sub Class_Initialize()

End Sub

Private Sub Class_Terminate()

End Sub

Private Function Interface_1_M1() As Variant

End Function

Private Function Interface_1_M2() As Variant

End Function
'--------------------------------------------


--
Essam Salah
Senior Developer
MTSE

Author
22 May 2005 2:43 PM
Bob Butler
"Essam Salah" <mt***@link.net> wrote in message
news:%239y$KOtXFHA.2288@TK2MSFTNGP14.phx.gbl
> Dear All
>
> I have an interface class like Interface_1 with event and methods like
> event1,event2 , M1() , M2
>
> If I implemet this interface in other calss like myClass  ; I can
> implement the mothods M1() , M2() only but cannot raise the events
> event1,event2

Events aren't part of the interface, just add them to your classes

Also, please trim the crosspost if you reply.  Of the groups you included
only m.p.vb.general.discussion is appropriate for this question.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
22 May 2005 10:34 PM
Michael C
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:u9jWpytXFHA.3840@tk2msftngp13.phx.gbl...
> Events aren't part of the interface, just add them to your classes

I noticed the other day that the events are parts of the interface in
vb.net/c#.

Michael
Author
22 May 2005 10:53 PM
Mike D Sutton
[irrelevant groups snipped]

> I noticed the other day that the events are parts of the interface in
> vb.net/c#.

AFAIK this is because events are implemented in a different way (via delegates) in these languages.  IMO events _should_
be part of interfaces but this was not the case in VB6 unfortunately.
FWIW,

    Mike


- Microsoft Visual Basic MVP -
E-Mail: ED***@mvps.org
WWW: Http://EDais.mvps.org/
Author
23 May 2005 12:35 AM
Bob Butler
"Michael C" <mculley@NOSPAMoptushome.com.au> wrote in message
news:epWhT5xXFHA.796@TK2MSFTNGP10.phx.gbl
> "Bob Butler" <tiredofit@nospam.com> wrote in message
> news:u9jWpytXFHA.3840@tk2msftngp13.phx.gbl...
>> Events aren't part of the interface, just add them to your classes
>
> I noticed the other day that the events are parts of the interface in
> vb.net/c#.

Could be; neither of those languages is VB though.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
23 May 2005 1:31 AM
Michael C
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:uhFvY9yXFHA.3164@TK2MSFTNGP12.phx.gbl...
> Could be; neither of those languages is VB though.

Could be, it doesn't have most of the faults of VB.

Michael
Author
23 May 2005 2:49 AM
Jeff Johnson [MVP: VB]
"Michael C" <mculley@NOSPAMoptushome.com.au> wrote in message
news:O0KLKczXFHA.2076@TK2MSFTNGP15.phx.gbl...

>> Could be; neither of those languages is VB though.
>
> Could be, it doesn't have most of the faults of VB.

Troll, troll, troll your boat....
Author
23 May 2005 3:10 AM
Michael C
"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message
news:uF%23htI0XFHA.2884@tk2msftngp13.phx.gbl...
>> Could be, it doesn't have most of the faults of VB.
>
> Troll, troll, troll your boat....

Sorry, couldn't help myself. :-)

Michael
Author
23 May 2005 1:52 PM
Bob Butler
"Michael C" <mculley@NOSPAMoptushome.com.au> wrote in message
news:O0KLKczXFHA.2076@TK2MSFTNGP15.phx.gbl
> "Bob Butler" <tiredofit@nospam.com> wrote in message
> news:uhFvY9yXFHA.3164@TK2MSFTNGP12.phx.gbl...
>> Could be; neither of those languages is VB though.
>
> Could be, it doesn't have most of the faults of VB.

All languages have their faults and limitations.  It's a real shame because
the core VB language could have been extended and many of the "faults"
repaired without discarding the baby with the bath water.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
23 May 2005 9:48 PM
Michael C
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:e36Fq65XFHA.3572@TK2MSFTNGP12.phx.gbl...
> All languages have their faults and limitations.  It's a real shame
> because
> the core VB language could have been extended and many of the "faults"
> repaired without discarding the baby with the bath water.

Have you used .net much? Originally I would have agreed with you but after
using it a while I understand why they had to start over.

Michael
Author
23 May 2005 10:47 PM
Bob Butler
"Michael C" <mculley@NOSPAMoptushome.com.au> wrote in message
news:elUlFE%23XFHA.3620@TK2MSFTNGP09.phx.gbl
> "Bob Butler" <tiredofit@nospam.com> wrote in message
> news:e36Fq65XFHA.3572@TK2MSFTNGP12.phx.gbl...
>> All languages have their faults and limitations.  It's a real shame
>> because
>> the core VB language could have been extended and many of the
>> "faults" repaired without discarding the baby with the bath water.
>
> Have you used .net much? Originally I would have agreed with you but
> after using it a while I understand why they had to start over.

I have used it, although I abandoned VB.Net as a joke early on and what I
have done has been using C#.

I do not mean that they had to stay with the COM platform.  I mean that they
should have done everything possible to retain as much source-level
compatibility with the language as possible.  VB did *not* have to be
trashed in order to extend it.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Author
24 May 2005 12:00 AM
Michael C
"Bob Butler" <tiredofit@nospam.com> wrote in message
news:uInGwl%23XFHA.228@TK2MSFTNGP12.phx.gbl...
> I have used it, although I abandoned VB.Net as a joke early on and what I
> have done has been using C#.

Same here, although I didn't think vb.net was a joke, I just thought it
would be better to go with C#. I was suprised what a non event switching
was.

> I do not mean that they had to stay with the COM platform.  I mean that
> they
> should have done everything possible to retain as much source-level
> compatibility with the language as possible.  VB did *not* have to be
> trashed in order to extend it.

I partly agree but partly don't. I think some sort of radical change was
needed but they should have made a better upgrade path. In what you wrote i
would remove the words "everything possible" and replaced it with "a lot
more". I think if they did everything possible there would be too many
compromises.

Michael
Author
24 May 2005 1:27 AM
Ken Halter
"Michael C" <mculley@NOSPAMoptushome.com.au> wrote in message
news:e2y9sN$XFHA.2572@TK2MSFTNGP14.phx.gbl...
> "Bob Butler" <tiredofit@nospam.com> wrote in message
> news:uInGwl%23XFHA.228@TK2MSFTNGP12.phx.gbl...
>> I have used it, although I abandoned VB.Net as a joke early on and what I
>> have done has been using C#.
>
> Same here, although I didn't think vb.net was a joke, I just thought it
> would be better to go with C#. I was suprised what a non event switching
> was.

Just another "noble defender" eh?

The Slow Brain Death of VB.NET
"VB.NET is so awesome of an upgrade, in fact, that these noble defenders of
the faith chose not to use it."
http://www.codinghorror.com/bl­og/archives/000235.html

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Sign up now to help keep VB support alive - http://classicvb.org/petition
Please keep all discussions in the groups..
Author
24 May 2005 3:55 AM
Michael C
"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
news:%23MnFI9$XFHA.4032@tk2msftngp13.phx.gbl...
> The Slow Brain Death of VB.NET
> "VB.NET is so awesome of an upgrade, in fact, that these noble defenders
> of
> the faith chose not to use it."
> http://www.codinghorror.com/bl­og/archives/000235.html

HTTP Error 404 - File or directory not found.

Michael
Author
24 May 2005 4:24 PM
Chris Lieb
If you copy the link text into your address bar, it works fine.  It was a
typo in the actual link.  Instead of sending you to
www.codinghorror.com/blog/... , it instead pointed you to
www.codinghorror.com/bl-og/... I've notified Mr. Halter about his error and
hopefully he will fix it in future posts.

Chris Lieb

Show quoteHide quote
"Michael C" wrote:

> "Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> wrote in message
> news:%23MnFI9$XFHA.4032@tk2msftngp13.phx.gbl...
> > The Slow Brain Death of VB.NET
> > "VB.NET is so awesome of an upgrade, in fact, that these noble defenders
> > of
> > the faith chose not to use it."
> > http://www.codinghorror.com/bl­og/archives/000235.html
>
> HTTP Error 404 - File or directory not found.
>
> Michael
>
>
>