Problem about implement interface


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Problem about implement interface

  1. #1
    Arger Guest

    Problem about implement interface


    Hi:
    I design a class with VB6.assume the class name is Cete.Cete implement
    IEvent interface.

    'in IEvent
    Public Sub Account()
    End Sub

    'in Cete Class
    Public Event Alarm(Byval Count as integer)
    implement IEvent

    Private Sub IEvent_Account()
    Beep
    RaiseEvent Alarm(5) 'Doesn't work
    End Sub

    How can i call method or event of Cete class From IEvent_Account?

  2. #2
    Michael Culley Guest

    Re: Problem about implement interface


    Arger,

    What you have should work. What does it do wrong? Sometimes events don't
    fire when they should. Is this the problem?

    Michael Culley

    "Arger" <Arger@Chinaren.Com> wrote:
    >
    >Hi:
    > I design a class with VB6.assume the class name is Cete.Cete implement
    >IEvent interface.
    >
    > 'in IEvent
    > Public Sub Account()
    > End Sub
    >
    > 'in Cete Class
    > Public Event Alarm(Byval Count as integer)
    > implement IEvent
    >
    > Private Sub IEvent_Account()
    > Beep
    > RaiseEvent Alarm(5) 'Doesn't work
    > End Sub
    >
    > How can i call method or event of Cete class From IEvent_Account?



  3. #3
    Charanjit Guest

    Re: Problem about implement interface


    Hi Arger,
    I have tested it and it is working perfectly.
    Many times we find that a perticular event we want to raise is not working.
    The culprit in those cases is not the class that raises the event but the
    event handler class. One may have written the event handler in a class but
    we must ascertain that at the time the event is raised, the object that has
    the event handler should be in memory i.e. the object should not be already
    destroyed.


    "Arger" <Arger@Chinaren.Com> wrote:
    >
    >Hi:
    > I design a class with VB6.assume the class name is Cete.Cete implement
    >IEvent interface.
    >
    > 'in IEvent
    > Public Sub Account()
    > End Sub
    >
    > 'in Cete Class
    > Public Event Alarm(Byval Count as integer)
    > implement IEvent
    >
    > Private Sub IEvent_Account()
    > Beep
    > RaiseEvent Alarm(5) 'Doesn't work
    > End Sub
    >
    > How can i call method or event of Cete class From IEvent_Account?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center