Ahh good. Just making sure to avoid any silly problems later.
For moving the ReceivedBytes over to a module, I have a somewhat simple solution: use a class module and WithEvents to respond to the events. Goes like this..
1- If your handling code is not already in a class module, stick it in there. Normal, .bas modules won't work with WithEvents.
2- Instatiate the new class on startup..
Private myObject As Class1
Private Sub Form_Load()
Set myObject = New Class1
End Sub
3- in the class module, use WithEvents..
Private WithEvents theSocket As okSocket
'after typing this, theSocket and its events will be selectable from the dropdowns
Private Sub Class_Initialize()
Set theSocket = frmMain.OutSimSocket
End Sub
Private Sub theSocket_ReceivedBytes(lngSocket As Long, bytData As Variant, lngLength As Long)
Debug.Print "we have bytes!"
End Sub
Of course, keep the little socket control on the form. Should work for ya. If not, I will post an example too. Let me know.
:up: