VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "CvbwDebugger"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' This class hosts VbwSck62 which provides socket implementation '
' for bidirectional communication with the VB Watch Debugger         '
Option Explicit
Private WithEvents VBWatchCommunications As VbwSck62.Socket
Attribute VBWatchCommunications.VB_VarHelpID = -1

' vbwNoTraceProc vbwNoTraceLine vbwNoInstanceCount ' don't remove this ! '
' vbwNoErrorHandler                                                      '

Private Sub Class_Initialize()
   Set VBWatchCommunications = New VbwSck62.Socket
   VBWatchCommunications.ClientThreadID = App.ThreadID
End Sub

Private Sub Class_Terminate()
   Set VBWatchCommunications = Nothing
   vbwStopDebugging
End Sub

Public Function SendMessage(ByVal MessageCode As Long, ByVal MessageBody As String) As Long
   VBWatchCommunications.SendDebugger MessageCode, MessageBody
End Function

Private Sub VBWatchCommunications_ReceivedMessage(MessageCode As Long, MessageBody As String)
   vbwMessageReceived MessageCode, MessageBody
End Sub

Private Sub VBWatchCommunications_StopDebug()
   vbwStopDebugging
End Sub

Public Sub SetConnection(Address As String, Port As Long)
   vbwDebug = VBWatchCommunications.ConnectDebugger(Address, Port)
End Sub
