|
-
September 26th, 2001, 08:42 AM
#1
Events
I´m going to build a Com-object (ActiveX-dll) with interfaces. How did I manage the events? (The implements feature does not support outgoing interfaces)
Thanks for help!
-
September 26th, 2001, 09:21 AM
#2
Re: Events
Here's a very simple example that should help get you started.
In a form module:
option Explicit
Dim withevents x as Class1
private Sub Form_Load()
me.Show
set x = new Class1
x.RunObject
End Sub
private Sub x_MyEvent()
MsgBox "Event Fired"
End Sub
In a class module:
option Explicit
public Event MyEvent()
public Sub RunObject()
Dim x as Long
for x = 1 to 10000
DoEvents
next
RaiseEvent MyEvent
End Sub
-
September 26th, 2001, 11:59 AM
#3
Re: Events
My question was a bit short.
I have a IClass (interface) for the ingoing (properties and sub/function) and like to have a outgoing interface for the events (IClassEvent).
I have a Class module where I Implement my IClass for the methods and properties. I declare my Event Public and Raise the Event.
Then from the Client I like to declare two variables.
[Private WithEvents mp_ClassEvent As Class
Private mp_Class As IClass]
and then Instantiate them.
[Set mp_Class As Class
Set mp_ClassEvent As Class]
But the events didn´t fire.
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
|
Click Here to Expand Forum to Full Width
|