everytimes i changed and modified code again.this is comming from this
event i put another first class.vb and this second class.vb is calling
from first class . and second class goes into mainPirchatechat form.
this is first class. if i change code again i will get error line 14
from mainPirateChat form
Private Sub Netsock_onDataArrival(ByVal Data() As Byte, ByVal
TotalBytes As Integer) Handles Netsock.onDataArrival
Dim inData As String = Netsock.BytestoString(Data)
Dim lData(), C(), CLi As String, tData, CL, a, i As Integer
Dim b() As String
lData = Split(inData, Chr(10))
tData = UBound(lData) - LBound(lData)
For a = 0 To tData
If Mid(lData(a), 1, 1) = ":" Then
lData(a) = Mid(lData(a), 2)
End If
Next
For CL = 0 To tData
C = Split(lData(CL), " ")
ReDim Preserve C(32767)
CLi = lData(CL)
Dim spNick As String(), sNick As String
Dim strNick As String = CLi
spNick = strNick.Split("!")
sNick = spNick(0)
If C(0) = "PING" Then
'
nStatus.rtbStatus.DisplayMessage(nStatus.rtbStatus , "PONG :" &
C(1).Substring(1))
RaiseEvent onSeverMessage("PONG :" & C(1).Substring(1))
Netsock.SendData(Netsock.StringToBytes("PONG :" &
C(1).Substring(1) & vbCrLf))
End If
If C(0) = "ERROR" Then
Dim int2 As Integer = CLi.IndexOf(":")
CLi = CLi.Substring(int2 + 1)
RaiseEvent onSeverMessage(CLi.ToString)
End If
If C(0) = "NOTICE" Then
Dim int3 As Integer = CLi.IndexOf("NOTICE")
CLi = CLi.Substring(C(0).Length - 6)
RaiseEvent onSeverMessage(CLi)
ElseIf C(1) = "NOTICE" And C(2) = "AUTH" Then
Dim int1 As Integer = CLi.IndexOf(C(0))
CLi = CLi.Substring(C(0).Length)
RaiseEvent onSeverMessage(CLi)
ElseIf C(1) = "NOTICE" And C(2) = Netsock.Nick Then
Dim nic As Integer = CLi.IndexOf(C(0))
CLi = CLi.Substring(C(0).Length + 1 + C(1).Length +
1 + Netsock.Nick.Length)
RaiseEvent onSeverMessage(CLi)
End If
'Select Case C(1)
'Case "001" To "376"
If C(2) = Netsock.Nick Then
Dim servString As String
Dim intI As Integer = CLi.IndexOf(Netsock.Nick)
servString = CLi.Substring(intI + Netsock.Nick.Length)
RaiseEvent onSeverMessage(servString)
servString = String.Empty
End If
'End Select
Debug.WriteLine(CLi)
Next
End Sub
regards,
Supra wrote:
'February 2004
'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.
Option Explicit On
Option Strict Off
Imports System
Imports System.Text
'Imports System.Net.Dns
'Imports System.Net.Sockets
Namespace PirateChat
Public Class mainPirateChat <===== The error occurred here in
line 14
Inherits System.Windows.Forms.Form
Private WithEvents netBots As New PirateChat.ClientFactory
Private WithEvents Netsock As New PirateChat.SockFactory
Dim clsReader As New PirateChat.clsReadWriteXML
Dim nlform As New PirateChat.frmNotifyLists
Dim frmPref As New PirateChat.frmPreferences
:
:
:
:
End Class
End Namespace
Herfried K. Wagner [MVP] wrote:
"Supra" <su*****@rogers.com> schrieb:
here is debug:
at PirateChat.PirateChat.mainPirateChat.Main() in C:\Documents and
Settings\Afraz\My Documents\Visual Studio
Projects\VbNet\project\PirateChat\mainPirateChat.v b:line 14
Can you post the source code of your main method? What's the code on
line 14?