A
Armin Zingler
Hi,
I add a TraceListener to Debug.Listeners. After that I use Debug.writeline.
Problem: Nothing arrives at the listener.
Code:
Dim ts As New TraceStream
Debug.Listeners.Add(New TextWriterTraceListener(ts))
Class Tracestream is a class inherited from IO.Stream:
Public Class TraceStream
Inherits IO.Stream
Public Overrides ReadOnly Property CanRead() As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property CanWrite() As Boolean
Get
Return True
End Get
End Property
'....other overrides
Public Overrides Sub Write( _
ByVal buffer() As Byte, ByVal offset As Integer, _
ByVal count As Integer)
'...
End Sub
End Class
I expect method Write to be called whenever Debug.Writeline is called, but
this doesn't happen. CanRead and CanWrite do get called.
Do I have a problem in understanding the Listeners concept?
Armin
I add a TraceListener to Debug.Listeners. After that I use Debug.writeline.
Problem: Nothing arrives at the listener.
Code:
Dim ts As New TraceStream
Debug.Listeners.Add(New TextWriterTraceListener(ts))
Class Tracestream is a class inherited from IO.Stream:
Public Class TraceStream
Inherits IO.Stream
Public Overrides ReadOnly Property CanRead() As Boolean
Get
Return False
End Get
End Property
Public Overrides ReadOnly Property CanWrite() As Boolean
Get
Return True
End Get
End Property
'....other overrides
Public Overrides Sub Write( _
ByVal buffer() As Byte, ByVal offset As Integer, _
ByVal count As Integer)
'...
End Sub
End Class
I expect method Write to be called whenever Debug.Writeline is called, but
this doesn't happen. CanRead and CanWrite do get called.
Do I have a problem in understanding the Listeners concept?
Armin