I have a program that chats to two public chat areas in skype, the problem is when I exit the program it will attach it self to skype again and then crash.

My program is in VB6, is there an exit I must use before I close my program ?

here is what I have so far..

Create a form with two textboxs with multi lines and vertical scroll, plus a button.. make sure you have SKYPE4COMLib referenced. I'm using version 1.0.27.0

CODE

Option Explicit
Public WithEvents Z_skype As Skype

Private Sub Form_Load()

Set Z_skype = New Skype
    Z_skype.Attach

End Sub

Private Sub Command1_Click()

Dim chatcounts As Long
For chatcounts = 1 To Z_skype.BookmarkedChats.Count
If Z_skype.BookmarkedChats.Item(chatcounts).Name = "#taffyakachris/$991ebf2c850c6ca7" Then
Z_skype.BookmarkedChats.Item(chatcounts).SendMessage Text1.Text
End If
Next chatcounts
Text1.Text = ""

End Sub

Private Sub z_skype_MessageStatus(ByVal pMessage As SKYPE4COMLib.IChatMessage, ByVal Status As SKYPE4COMLib.TChatMessageStatus)
On Error GoTo Statfin

If Status = cmsRead Then
    
End If

If Status = cmsReceived Then
        
        If pMessage.ChatName = "#taffyakachris/$991ebf2c850c6ca7" Then
            Text2 = pMessage.FromDisplayName & " : " & pMessage.Body & vbCrLf & Text2
        End If

End If

If Status = cmsSending Then
        If pMessage.ChatName = "#taffyakachris/$991ebf2c850c6ca7" Then
            Text2 = pMessage.FromDisplayName & " : " & pMessage.Body & vbCrLf & Text2
        End If
End If

If Status = cmsSent Then
    
End If

If Status = cmsUnknown Then
  
End If

Statfin:
End Sub



I'm not sure if its this part or because I have this form as part of a program, but when I exit the form its as though it attaches it self again to skype and then crashed my application crying.png