|
-
May 4th, 2001, 12:17 PM
#1
Thread Starter
New Member
RaiseEvent and com interface
i made a class with an event that works just fine.
After i try to make a com interface between the class and a form, the raiseevent won't work anymore.
I get the errormessage:
Object or class does not support the set of events
Here is the code:
' the class named clsTest
Option Explicit
Implements iTest
Public mvarname As String 'local copy
Public mvaryear As Integer 'local copy
Public Event filled()
Public Sub iTest_fil(ByVal name As String, ByVal year As Integer)
mvarname = name
mvaryear = year
RaiseEvent filled
End Sub
Public Property Let iTest_year(ByVal vData As Integer)
mvaryear = vData
End Property
Public Property Get iTest_year() As Integer
year = mvaryear
End Property
Public Property Let iTest_name(ByVal vData As String)
mvarname = vData
End Property
Public Property Get iTest_name() As String
name = mvarname
End Property
'the interface named iTest
Option Explicit
Private mvarname As String 'local copy
Private mvaryear As Integer 'local copy
Public Event filled()
Public Sub fil(ByVal name As String, ByVal year As Integer)
End Sub
Public Property Let year(ByVal vData As Integer)
End Property
Public Property Get year() As Integer
End Property
Public Property Let name(ByVal vData As String)
End Property
Public Property Get name() As String
End Property
'the form
Option Explicit
Public WithEvents myTest As iTest
Private Sub Command1_Click()
myTest.fil Text1.Text, Text2.Text
End Sub
Private Sub Form_Load()
Set myTest = New clstest
End Sub
Private Sub myTest_filled()
MsgBox "filled"
End Sub
Anyone any idea why the raiseevent doesn't work anymore?
Thanks anyway.
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
|