S
Supra
in class1 : i used public event
Public Event onSeverMessage(ByVal szText As String)
then in class 2 i called from class1
Private WithEvents _Connection As New Class1
then i did withevents
Private Sub _Connection_onSeverMessage(ByVal szText As String) Handles
_Connection.onSeverMessage
DisplayMessage(nStatus.rtbStatus, szText) <=== this wIll
cause error problem because of szText needed to instantiate object but
i'm not sure
End Sub
now if i replaced szText to " " then i can see all data comming in debug
window this will gave no error problem
then back in class1 then i did raisevents
Select Case C(1).Trim
Case "001" To "014", "251" To "272", "372" To "377",
"401", "422", "462", "468", "503"
Dim intA As Integer = CLi.IndexOf(Nick, 0)
RaiseEvent onSeverMessage(CLi.Substring(intA +
Nick.Length))
\\\
end select
the error is 'An unhandled exception of type
'System.NullReferenceException' occurred in system.windows.forms.dll
'Additional information: Object reference not set to an instance of an
object.
regards,
Public Event onSeverMessage(ByVal szText As String)
then in class 2 i called from class1
Private WithEvents _Connection As New Class1
then i did withevents
Private Sub _Connection_onSeverMessage(ByVal szText As String) Handles
_Connection.onSeverMessage
DisplayMessage(nStatus.rtbStatus, szText) <=== this wIll
cause error problem because of szText needed to instantiate object but
i'm not sure
End Sub
now if i replaced szText to " " then i can see all data comming in debug
window this will gave no error problem
then back in class1 then i did raisevents
Select Case C(1).Trim
Case "001" To "014", "251" To "272", "372" To "377",
"401", "422", "462", "468", "503"
Dim intA As Integer = CLi.IndexOf(Nick, 0)
RaiseEvent onSeverMessage(CLi.Substring(intA +
Nick.Length))
\\\
end select
the error is 'An unhandled exception of type
'System.NullReferenceException' occurred in system.windows.forms.dll
'Additional information: Object reference not set to an instance of an
object.
regards,