-
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?
-
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?
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks