Handlers

Samplusplus

New member
Joined
Jun 5, 2006
Messages
4
Programming Experience
1-3
I am using the fluent toc protocol to design my own aim client, but for some reason i can not get recieve ims to work, if anyone can help me that would be apprciated
VB.NET:
Imports Fluent
Public Class Buddylist
Public tc As New Fluent.Toc.TocClient
Private Sub Buddylist_show(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
tc = Signon.tc
AddHandler tc.Message, AddressOf OnMessage
'Listen for im's
tc.StartListening()
'Set the name of the buddy in the buddy list title
Me.Text = tc.ScreenName
Me.Text += "'s Buddy List"
'Load Buddy List
'Still Connecting
System.Threading.Thread.Sleep(5000)
For i As Integer = 0 To tc.Buddies.Count - 1
Me.Buddies.Items.Add(tc.Buddies(i))
Next
End Sub
 
Private Sub SendImToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SendImToolStripMenuItem.Click
Imform.Show()
End Sub
 
Private Sub SignOffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SignOffToolStripMenuItem.Click
'Confirm Exit and then signoff aim
If (MsgBox("Are you sure?", MsgBoxStyle.YesNo, "Exit Application") = MsgBoxResult.Yes) Then
'System hangs weird
tc.SignOff()
Me.Hide()
Signon.Show()
End If
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
'Confirm Exit and then shutdown Program
If (MsgBox("Are you sure?", MsgBoxStyle.YesNo, "Exit Application") = MsgBoxResult.Yes) Then
Signon.Close()
End If

 
End Sub
Protected Sub OnMessage(ByVal sender As Object, ByVal e As Toc.MessageEventArgs)
Imform.RecievedIms.Text += e.From + e.Message
End Sub
End Class
 
Surely you want to create a new instance of your imform when you recieve a message from a new contact?

has the Toc message event arguments got a unique id of some sort to help you determine the current conversation?

try putting Imform.Show() in your OnMessage handler
 
Back
Top