Results 1 to 5 of 5

Thread: Events

  1. #1

    Thread Starter
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261

    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
     
    
    ...
    ...
    ...
    ...
    ..
    - regards -
    - razzaj -

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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:
    1. OnTextReceived(pIMSession As IMsgrIMSession, pSourceUser As IMsgrUser, bstrMsgHeader As String, bstrMsgText As String, pfEnableDefault As Boolean)
    2.  
    3. 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]

  3. #3

    Thread Starter
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261
    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.
    - regards -
    - razzaj -

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Have you declared

    IMsgrIMSession
    IMsgrUser

    as UDTs ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5

    Thread Starter
    Hyperactive Member razzaj's Avatar
    Join Date
    Oct 1999
    Location
    jounieh
    Posts
    261
    no they are not UDT they are in the libraries i referenced.
    anyway it worked it was something stupid i forgot. thanks anyway
    - regards -
    - razzaj -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width