473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Additional information: Object reference not set to an instance ofan object................

I am doing irc chat similar to mirc chat if i connected to
irc.webamster.com i had no problem. but if connected to eu.undernet.org.
i got error....somthing bug me! O:-)
'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 <============ error occurred here in bold
Inherits System.Windows.Forms.Form

Private WithEvents netBots As New PirateChat.ClientFactory
Private WithEvents Netsock As New PirateChat.SockFactory
Private clsReader As New PirateChat.clsReadWriteXML

Private Sub mnuWindowCascade_Click_1(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
mnuWindowCascade.Click, mnuWindowTitleH.Click, mnuWindowTitleV.Click,
mnuWindowArrange.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "&Cascade"
Me.LayoutMdi(MdiLayout.Cascade)
Case "Title Horizontal"
Me.LayoutMdi(MdiLayout.TileHorizontal)
Case "Title &Vertical"
Me.LayoutMdi(MdiLayout.TileVertical)
Case "&Arrange Icons"
Me.LayoutMdi(MdiLayout.ArrangeIcons)

End Select
End Sub

Private Sub mnuIrc_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles mnuIrcConnect.Click, mnuIrcPref.Click,
mnuIrcExit.Click

Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Connect"
netBots.ConnectServer()
Case "Preferences..."
Dim frmPref As New PirateChat.frmPreferences
frmPref.MdiParent = Me
frmPref.Show()
Case "Exit"
Me.Close()
End Select
End Sub

Private Sub mnuServer_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles mnuSerAdm.Click, mnuSerMotd.Click,
mnuSerInfo.Click, _
mnuSerMap.Click, mnuSerLink.Click, mnuSerVer.Click,
mnuSerCom.Click, mnuSerTime.Click, mnuSerLoAU.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Admin Info"
Netsock.SendData(Netsock.StringToBytes("admin" &
vbCrLf))
Case "MOTD"
Netsock.SendData(Netsock.StringToBytes("motd" & vbCrLf))
Case "Server Info"
Netsock.SendData(Netsock.StringToBytes("server" &
vbCrLf))
Case "Map Info"
Netsock.SendData(Netsock.StringToBytes("map" & vbCrLf))
Case "Link Info"
Netsock.SendData(Netsock.StringToBytes("links" &
vbCrLf))
Case "Server's Commands"

Case "Server's Time"
Netsock.SendData(Netsock.StringToBytes("time" & vbCrLf))
Case "Server's Version"
Netsock.SendData(Netsock.StringToBytes("version" &
vbCrLf))

Case "List of All Users"
End Select
End Sub

Private Sub mnuInfo_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles mnuInfoAlias.Click, mnuInfoStart.Click,
mnuInfoChan.Click, _
mnuInfoNot.Click, mnuInfoserInf.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Aliases..."
mnuFrmHandling(mi.Text)
Case "Startup..."
mnuFrmHandling(mi.Text)
Case "Channels..."
mnuFrmHandling(mi.Text)
Case "Notify lists..."
Dim nlform As New frmNotifyLists
nlform.MdiParent = Me
nlform.Show()
Case "Server's status"

netBots.nStatus.MdiParent = Me
netBots.nStatus.Show()
End Select
End Sub

Private Sub mnuFrmHandling(ByVal frmName As String)

For Each frm As Form In Me.MdiChildren
If frm.Name = frmName Then
frm.BringToFront()
Exit Sub
End If
Next

Dim frmNew As frmAlias
frmNew = New frmAlias
frmNew.MdiParent = Me
frmNew.Name = frmName

Select Case frmName
Case "Aliases..."
frmNew.Text = frmName

Case "Startup..."
frmNew.Text = frmName

Case "Channels..."
frmNew.Text = frmName
End Select
frmNew.Show()
End Sub

End Class
End Namespace
Nov 21 '05 #1
4 1382
you have no try catch statements. Therefore, you cannot see where the
actual error is occurring.

Please use error handling to narrow down the location of your error.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Supra" <su*****@rogers.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I am doing irc chat similar to mirc chat if i connected to irc.webamster.com
i had no problem. but if connected to eu.undernet.org. i got
error....somthing bug me! O:-)
'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 <============ error occurred here in bold
Inherits System.Windows.Forms.Form

Private WithEvents netBots As New PirateChat.ClientFactory
Private WithEvents Netsock As New PirateChat.SockFactory
Private clsReader As New PirateChat.clsReadWriteXML

Private Sub mnuWindowCascade_Click_1(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mnuWindowCascade.Click,
mnuWindowTitleH.Click, mnuWindowTitleV.Click, mnuWindowArrange.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "&Cascade"
Me.LayoutMdi(MdiLayout.Cascade)
Case "Title Horizontal"
Me.LayoutMdi(MdiLayout.TileHorizontal)
Case "Title &Vertical"
Me.LayoutMdi(MdiLayout.TileVertical)
Case "&Arrange Icons"
Me.LayoutMdi(MdiLayout.ArrangeIcons)

End Select
End Sub

Private Sub mnuIrc_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuIrcConnect.Click, mnuIrcPref.Click,
mnuIrcExit.Click

Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Connect"
netBots.ConnectServer()
Case "Preferences..."
Dim frmPref As New PirateChat.frmPreferences
frmPref.MdiParent = Me
frmPref.Show()
Case "Exit"
Me.Close()
End Select
End Sub

Private Sub mnuServer_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles mnuSerAdm.Click, mnuSerMotd.Click,
mnuSerInfo.Click, _
mnuSerMap.Click, mnuSerLink.Click, mnuSerVer.Click, mnuSerCom.Click,
mnuSerTime.Click, mnuSerLoAU.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Admin Info"
Netsock.SendData(Netsock.StringToBytes("admin" &
vbCrLf))
Case "MOTD"
Netsock.SendData(Netsock.StringToBytes("motd" & vbCrLf))
Case "Server Info"
Netsock.SendData(Netsock.StringToBytes("server" &
vbCrLf))
Case "Map Info"
Netsock.SendData(Netsock.StringToBytes("map" & vbCrLf))
Case "Link Info"
Netsock.SendData(Netsock.StringToBytes("links" &
vbCrLf))
Case "Server's Commands"

Case "Server's Time"
Netsock.SendData(Netsock.StringToBytes("time" & vbCrLf))
Case "Server's Version"
Netsock.SendData(Netsock.StringToBytes("version" &
vbCrLf))

Case "List of All Users"
End Select
End Sub

Private Sub mnuInfo_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles mnuInfoAlias.Click, mnuInfoStart.Click,
mnuInfoChan.Click, _
mnuInfoNot.Click, mnuInfoserInf.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Aliases..."
mnuFrmHandling(mi.Text)
Case "Startup..."
mnuFrmHandling(mi.Text)
Case "Channels..."
mnuFrmHandling(mi.Text)
Case "Notify lists..."
Dim nlform As New frmNotifyLists
nlform.MdiParent = Me
nlform.Show()
Case "Server's status"

netBots.nStatus.MdiParent = Me
netBots..nStatus.Show()
End Select
End Sub

Private Sub mnuFrmHandling(ByVal frmName As String)

For Each frm As Form In Me.MdiChildren
If frm.Name = frmName Then
frm.BringToFront()
Exit Sub
End If
Next

Dim frmNew As frmAlias
frmNew = New frmAlias
frmNew.MdiParent = Me
frmNew.Name = frmName

Select Case frmName
Case "Aliases..."
frmNew.Text = frmName

Case "Startup..."
frmNew.Text = frmName

Case "Channels..."
frmNew.Text = frmName
End Select
frmNew.Show()
End Sub

End Class
End Namespace
Nov 21 '05 #2
i am using public event and withevents
i did try catch end try statement.but not help.
the problem comming from withevents:

Private Sub _Connection_onSeverMessage(ByVal szText As String) Handles
_Connection.onSeverMessage
DisplayMessage(nStatus.rtbStatus, szText)
End Sub
thiss wll work only to effnet, dalnet webmaster. but not to undernet
servers.
regards

Nick Malik [Microsoft] wrote:
you have no try catch statements. Therefore, you cannot see where the
actual error is occurring.

Please use error handling to narrow down the location of your error.


Nov 21 '05 #3
:*** Looking up your hostname

:*** Checking Ident

:*** Couldn't look up your hostname

PING :1659113236

Helsinki.FI.EU.Undernet.org 001 djanjo2 :Welcome to the UnderNet IRC
Network via EUnet Finland, djanjo2
Helsinki.FI.EU.Undernet.org 002 djanjo2 :Your host is
Helsinki.FI.EU.Undernet.org, running version u2.10.11.06
Helsinki.FI.EU.Undernet.org 003 djanjo2 :This server was created Tue Jan
13 2004 at 08:59:14 EET
Helsinki.FI.EU.Undernet.org 004 djanjo2 Helsinki.FI.EU.Undernet.org
u2.10.11.06 dioswkgx biklmnopstvr bklov
Helsinki.FI.EU.Undernet.org 005 djanjo2 WHOX WALLCHOPS WALLVOICES USERIP
CPRIVMSG CNOTICE SILENCE=15 MODES=6 MAXCHANNELS=20 MAXBANS=45 NICKLEN=12
MAXNICKLEN=15 :are supported by this server
Helsinki.FI.EU.Undernet.org 254 djanjo2 49920 :channels formed
Helsinki.FI.EU.Undernet.org 255 djanjo2 :I have 7188 clients and 1 servers
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,
Nick Malik [Microsoft] wrote:
you have no try catch statements. Therefore, you cannot see where the
actual error is occurring.

Please use error handling to narrow down the location of your error.


Nov 21 '05 #4
Sorry that I'm not familiar with the protocol you are using. It appears
that one of the servers you are attempting to contact is responding with an
error message or is dropping the connection unexpectedly, and your code
doesn't handle that possibility very well. It is hard to tell. You posted
a lot of code... most of it is not useful to diagnose your problem. (This
is one reason that we break code into layers... all the code needed to debug
a problem is in one place, and isn't mixed up with other code).

Have you thought about sniffing the packets, so that you can see what the
undernet server is sending you (or not sending you) and you can then look
into your code to see if you are handling it correctly?

Just a suggestion. I hope this is helpful.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Supra" <su*****@rogers.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
:*** Looking up your hostname

:*** Checking Ident

:*** Couldn't look up your hostname

PING :1659113236

Helsinki.FI.EU.Undernet.org 001 djanjo2 :Welcome to the UnderNet IRC
Network via EUnet Finland, djanjo2
Helsinki.FI.EU.Undernet.org 002 djanjo2 :Your host is
Helsinki.FI.EU.Undernet.org, running version u2.10.11.06
Helsinki.FI.EU.Undernet.org 003 djanjo2 :This server was created Tue Jan
13 2004 at 08:59:14 EET
Helsinki.FI.EU.Undernet.org 004 djanjo2 Helsinki.FI.EU.Undernet.org
u2.10.11.06 dioswkgx biklmnopstvr bklov
Helsinki.FI.EU.Undernet.org 005 djanjo2 WHOX WALLCHOPS WALLVOICES USERIP
CPRIVMSG CNOTICE SILENCE=15 MODES=6 MAXCHANNELS=20 MAXBANS=45 NICKLEN=12
MAXNICKLEN=15 :are supported by this server
Helsinki.FI.EU.Undernet.org 254 djanjo2 49920 :channels formed
Helsinki.FI.EU.Undernet.org 255 djanjo2 :I have 7188 clients and 1 servers
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,
Nick Malik [Microsoft] wrote:
you have no try catch statements. Therefore, you cannot see where the
actual error is occurring.

Please use error handling to narrow down the location of your error.

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: michael walser | last post by:
I get this message in "Spaltenbreite definieren" => Definition for Columns Width An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication1.exe Additional...
6
by: Christopher Young | last post by:
I have several user controls on a page and I am trying to get information out of them. The postback is being caused on the aspx page and not in the user control. I have tried using a property but...
2
by: Brad | last post by:
Receive the following error when stepping into the FILL (see last line). Being a newbie I cannot see anything obvious. Error message: An unhandled exception of type...
1
by: Supra | last post by:
'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. in module: Dim...
5
by: Joseph Geretz | last post by:
Here's my first attempt at DIME (code below signature). I'ts basically straight out of Microsoft's online sample: For some reason, the statement respContext.Attachments.Add(dimeAttach); ...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
1
by: jadeite100 | last post by:
Hi All: I installed oracle report server 10.1.2.02 I tried the following url and it display the page properly that ask Test run Job: http://xxx/reports/rwwebservice?operation=runJob When I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.