Im using WithEvents to use a winsock object in my class
(uses as following: Dim WithEvents wskConnection as Winsock )


Now in my class initialize method, I use the following code:
wskConnection.Close


and I get an error 91...




Here is a code snippet:
VB Code:
  1. Option Explicit
  2. Dim WithEvents wskYMSG As Winsock
  3. Public iUsers As Integer '# of users in the room
  4. Public iPrivates As Integer '# of private messages received
  5.  
  6. Private Sub Class_Initialize()
  7.     sStatus = "offline"
  8.     iUsers = 0
  9.     iPrivates = 0
  10.  
  11.     wskYMSG.Close
  12.    
  13. End Sub

When I create a new object, and the class initializes, I get an error 91, I click Debut, and the line wskYMSG.Close is highlited..