|
-
Aug 2nd, 2001, 10:42 AM
#1
Thread Starter
Hyperactive Member
Events
I am trying to play around with the MSN libraries. and it contains events.
I dimed the object correctly as I usually do .
but the events are giving me the following compile error :
Procedure declaration does not match description of event or procedure having same name .
here is the Declaration I got from The object browser in VB IDE :
Code:
Event OnTextReceived(pIMSession As IMsgrIMSession, pSourceUser As IMsgrUser, bstrMsgHeader As String, bstrMsgText As String, pfEnableDefault As Boolean)
Here is my Code
Code:
Public WithEvents MyMessenger As Messenger.MsgrObject
Private Sub MyMessenger_OnTextReceived(pIMSession As Messenger.IMsgrIMSession, pSourceUser As Messenger.IMsgrUser, bstrMsgHeader As String, bstrMsgText As String, pfEnableDefault As Boolean)
MsgBox "alert2"
End Sub
Private Sub Form_Load()
Dim USers As IMsgrUsers
Dim USer As IMsgrUser2
Dim Msgr As New Messenger.MsgrObject
Dim count As Integer
Dim Addstring As String
Set MyMessenger = New Messenger.MsgrObject
...
...
...
...
..
-
Aug 2nd, 2001, 11:12 AM
#2
Retired VBF Adm1nistrator
I would imagine that what is happening is that VB is expecting to see an event in your code that matches exactly how the event would be called.
So then :
VB Code:
OnTextReceived(pIMSession As IMsgrIMSession, pSourceUser As IMsgrUser, bstrMsgHeader As String, bstrMsgText As String, pfEnableDefault As Boolean)
MyMessenger_OnTextReceived(pIMSession As Messenger.IMsgrIMSession, pSourceUser As Messenger.IMsgrUser, bstrMsgHeader As String, bstrMsgText As String, pfEnableDefault As Boolean)
Would not be equal.
You could probably fix the problem by declaring the appropriate Enums or UDTs.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 2nd, 2001, 08:49 PM
#3
Thread Starter
Hyperactive Member
I tried to leave it as it was Declared in the Object Browser .... and still it didnt work. I added Messenger. after the arguments because I was desperate to try and get it to work.
-
Aug 3rd, 2001, 02:11 AM
#4
Retired VBF Adm1nistrator
Have you declared
IMsgrIMSession
IMsgrUser
as UDTs ?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 3rd, 2001, 02:26 AM
#5
Thread Starter
Hyperactive Member
no they are not UDT they are in the libraries i referenced.
anyway it worked it was something stupid i forgot. 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
|