473,773 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.c om i had no problem. but if connected to eu.undernet.org .
i got error....somthi ng bug me! O:-)
'February 2004
'An unhandled exception of type 'System.NullRef erenceException ' 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.Sock ets

Namespace PirateChat

Public Class mainPirateChat <============ error occurred here in bold
Inherits System.Windows. Forms.Form

Private WithEvents netBots As New PirateChat.Clie ntFactory
Private WithEvents Netsock As New PirateChat.Sock Factory
Private clsReader As New PirateChat.clsR eadWriteXML

Private Sub mnuWindowCascad e_Click_1(ByVal sender As
System.Object, ByVal e As System.EventArg s) Handles
mnuWindowCascad e.Click, mnuWindowTitleH .Click, mnuWindowTitleV .Click,
mnuWindowArrang e.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "&Cascade"
Me.LayoutMdi(Md iLayout.Cascade )
Case "Title Horizontal"
Me.LayoutMdi(Md iLayout.TileHor izontal)
Case "Title &Vertical"
Me.LayoutMdi(Md iLayout.TileVer tical)
Case "&Arrange Icons"
Me.LayoutMdi(Md iLayout.Arrange Icons)

End Select
End Sub

Private Sub mnuIrc_Click(By Val sender As System.Object, ByVal e
As System.EventArg s) Handles mnuIrcConnect.C lick, mnuIrcPref.Clic k,
mnuIrcExit.Clic k

Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Connect"
netBots.Connect Server()
Case "Preferences... "
Dim frmPref As New PirateChat.frmP references
frmPref.MdiPare nt = Me
frmPref.Show()
Case "Exit"
Me.Close()
End Select
End Sub

Private Sub mnuServer_Click (ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles mnuSerAdm.Click , mnuSerMotd.Clic k,
mnuSerInfo.Clic k, _
mnuSerMap.Click , mnuSerLink.Clic k, mnuSerVer.Click ,
mnuSerCom.Click , mnuSerTime.Clic k, mnuSerLoAU.Clic k
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Admin Info"
Netsock.SendDat a(Netsock.Strin gToBytes("admin " &
vbCrLf))
Case "MOTD"
Netsock.SendDat a(Netsock.Strin gToBytes("motd" & vbCrLf))
Case "Server Info"
Netsock.SendDat a(Netsock.Strin gToBytes("serve r" &
vbCrLf))
Case "Map Info"
Netsock.SendDat a(Netsock.Strin gToBytes("map" & vbCrLf))
Case "Link Info"
Netsock.SendDat a(Netsock.Strin gToBytes("links " &
vbCrLf))
Case "Server's Commands"

Case "Server's Time"
Netsock.SendDat a(Netsock.Strin gToBytes("time" & vbCrLf))
Case "Server's Version"
Netsock.SendDat a(Netsock.Strin gToBytes("versi on" &
vbCrLf))

Case "List of All Users"
End Select
End Sub

Private Sub mnuInfo_Click(B yVal sender As System.Object, ByVal e
As System.EventArg s) Handles mnuInfoAlias.Cl ick, mnuInfoStart.Cl ick,
mnuInfoChan.Cli ck, _
mnuInfoNot.Clic k, mnuInfoserInf.C lick
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.MdiParen t = 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.BringToFron t()
Exit Sub
End If
Next

Dim frmNew As frmAlias
frmNew = New frmAlias
frmNew.MdiParen t = 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 1403
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******** ********@TK2MSF TNGP11.phx.gbl. ..
I am doing irc chat similar to mirc chat if i connected to irc.webamster.c om
i had no problem. but if connected to eu.undernet.org . i got
error....somthi ng bug me! O:-)
'February 2004
'An unhandled exception of type 'System.NullRef erenceException ' 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.Sock ets

Namespace PirateChat

Public Class mainPirateChat <============ error occurred here in bold
Inherits System.Windows. Forms.Form

Private WithEvents netBots As New PirateChat.Clie ntFactory
Private WithEvents Netsock As New PirateChat.Sock Factory
Private clsReader As New PirateChat.clsR eadWriteXML

Private Sub mnuWindowCascad e_Click_1(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles mnuWindowCascad e.Click,
mnuWindowTitleH .Click, mnuWindowTitleV .Click, mnuWindowArrang e.Click
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "&Cascade"
Me.LayoutMdi(Md iLayout.Cascade )
Case "Title Horizontal"
Me.LayoutMdi(Md iLayout.TileHor izontal)
Case "Title &Vertical"
Me.LayoutMdi(Md iLayout.TileVer tical)
Case "&Arrange Icons"
Me.LayoutMdi(Md iLayout.Arrange Icons)

End Select
End Sub

Private Sub mnuIrc_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles mnuIrcConnect.C lick, mnuIrcPref.Clic k,
mnuIrcExit.Clic k

Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Connect"
netBots.Connect Server()
Case "Preferences... "
Dim frmPref As New PirateChat.frmP references
frmPref.MdiPare nt = Me
frmPref.Show()
Case "Exit"
Me.Close()
End Select
End Sub

Private Sub mnuServer_Click (ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles mnuSerAdm.Click , mnuSerMotd.Clic k,
mnuSerInfo.Clic k, _
mnuSerMap.Click , mnuSerLink.Clic k, mnuSerVer.Click , mnuSerCom.Click ,
mnuSerTime.Clic k, mnuSerLoAU.Clic k
Dim mi As MenuItem = CType(sender, MenuItem)
Select Case mi.Text
Case "Admin Info"
Netsock.SendDat a(Netsock.Strin gToBytes("admin " &
vbCrLf))
Case "MOTD"
Netsock.SendDat a(Netsock.Strin gToBytes("motd" & vbCrLf))
Case "Server Info"
Netsock.SendDat a(Netsock.Strin gToBytes("serve r" &
vbCrLf))
Case "Map Info"
Netsock.SendDat a(Netsock.Strin gToBytes("map" & vbCrLf))
Case "Link Info"
Netsock.SendDat a(Netsock.Strin gToBytes("links " &
vbCrLf))
Case "Server's Commands"

Case "Server's Time"
Netsock.SendDat a(Netsock.Strin gToBytes("time" & vbCrLf))
Case "Server's Version"
Netsock.SendDat a(Netsock.Strin gToBytes("versi on" &
vbCrLf))

Case "List of All Users"
End Select
End Sub

Private Sub mnuInfo_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles mnuInfoAlias.Cl ick, mnuInfoStart.Cl ick,
mnuInfoChan.Cli ck, _
mnuInfoNot.Clic k, mnuInfoserInf.C lick
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.MdiParen t = Me
nlform.Show()
Case "Server's status"

netBots.nStatus .MdiParent = Me
netBots..nStatu s.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.BringToFron t()
Exit Sub
End If
Next

Dim frmNew As frmAlias
frmNew = New frmAlias
frmNew.MdiParen t = 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_onS everMessage(ByV al szText As String) Handles
_Connection.onS everMessage
DisplayMessage( nStatus.rtbStat us, 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.NullRef erenceException ' 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******** ********@TK2MSF TNGP14.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.NullRef erenceException ' 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
5973
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 information: Object reference not set to an instance of an object. Please help me.
6
3135
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 I keep getting a message that the object is not referenced. What I am trying to do is be information from text boxes and insert them into a new row in a dataset. The application has several tabs of information. I have a button set up so they...
2
1975
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 'System.NullReferenceException' occurred in system.data.dll Additional information: Object reference not set to an instance of an object. Code:
1
1270
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 nrtb As New RichTextBox Sub DisplayMessage(ByVal rtb As RichTextBox, ByVal sText As String, Optional ByVal Colour As String = "") rtb.SelectionStart = rtb.Text.Length ' rtb.doColor(rtb, DirectCast(sText, String))
5
4878
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); trips the following error: Object reference not set to an instance of an object.
12
5556
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. Foo = function(type) { this.num = 0; this.type = type this.trigger(); } Foo.prototype.trigger = function() {
2
2657
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
11110
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. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
1
6386
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 tried the url: http://xxx/reports/rwservlet/showJobs?server=rep_xxx_oracleas3 It is suppose to redirect me to an url to login. It did the first time. I was able to login using the id:orcladmin.
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.