can u fix this ...............

  • Thread starter Thread starter Supra
  • Start date Start date
S

Supra

at runtime i got error right away. so i am getting closer...just 1
errors in bolds. when i do step over i found same error in bold below
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.


Public Class mainPirateChat
Inherits System.Windows.Forms.Form
' Private netBots As New PirateChat.ClientFactory
Private Netsock As New PirateChat.SockFactory
Private WithEvents netBots As New PirateChat.ClientFactory
' Private WithEvents Netsock As New PirateChat.SockFactory
Private clsReader As New PirateChat.clsReadWriteXML

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
netBots = Nothing
Netsock = Nothing
clsReader = Nothing
Dim frmPref As New PirateChat.frmPreferences
frmPref.MdiParent = Me
Dim szReConnect As Collection =
clsReader.GetConfigInfo("Misc", "ReConnect", " ", "PirateChat.xml")
Dim getReConnect As String
For Each getReConnect In szReConnect
bReconnect = CBool(getReConnect)
frmPref.chkReConn.Checked = bReconnect
Next
Dim szStartup As Collection =
clsReader.GetConfigInfo("Misc", "Startup", " ", "PirateChat.xml")
Dim getStartup As String
For Each getStartup In szStartup
bStartup = getStartup
frmPref.chkStartup.Checked = getStartup
Next
End Sub
regards,
happy new yrs every 1
from supra
 
Something is wrong with GetConfigInfo - it's not finding the values you set - the file or something b/c the collection isn't being returned. Double check all of the spelling, spaces and capitalization in your xml file.

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
at runtime i got error right away. so i am getting closer...just 1 errors in bolds. when i do step over i found same error in bold below
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.


Public Class mainPirateChat
Inherits System.Windows.Forms.Form
' Private netBots As New PirateChat.ClientFactory
Private Netsock As New PirateChat.SockFactory
Private WithEvents netBots As New PirateChat.ClientFactory
' Private WithEvents Netsock As New PirateChat.SockFactory
Private clsReader As New PirateChat.clsReadWriteXML

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
netBots = Nothing
Netsock = Nothing
clsReader = Nothing
Dim frmPref As New PirateChat.frmPreferences
frmPref.MdiParent = Me
Dim szReConnect As Collection = clsReader.GetConfigInfo("Misc", "ReConnect", " ", "PirateChat.xml")
Dim getReConnect As String
For Each getReConnect In szReConnect
bReconnect = CBool(getReConnect)
frmPref.chkReConn.Checked = bReconnect
Next
Dim szStartup As Collection = clsReader.GetConfigInfo("Misc", "Startup", " ", "PirateChat.xml")
Dim getStartup As String
For Each getStartup In szStartup
bStartup = getStartup
frmPref.chkStartup.Checked = getStartup
Next
End Sub
regards,
happy new yrs every 1
from supra
 
clsReader = Nothing <---- this is causing NullReferenceException
....
Dim szReConnect As Collection = clsReader.GetConfigInfo("Misc", "ReConnect", " ", "PirateChat.xml")

Greg

at runtime i got error right away. so i am getting closer...just 1 errors in bolds. when i do step over i found same error in bold below
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.


Public Class mainPirateChat
Inherits System.Windows.Forms.Form
' Private netBots As New PirateChat.ClientFactory
Private Netsock As New PirateChat.SockFactory
Private WithEvents netBots As New PirateChat.ClientFactory
' Private WithEvents Netsock As New PirateChat.SockFactory
Private clsReader As New PirateChat.clsReadWriteXML

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
netBots = Nothing
Netsock = Nothing
clsReader = Nothing
Dim frmPref As New PirateChat.frmPreferences
frmPref.MdiParent = Me
Dim szReConnect As Collection = clsReader.GetConfigInfo("Misc", "ReConnect", " ", "PirateChat.xml")
Dim getReConnect As String
For Each getReConnect In szReConnect
bReconnect = CBool(getReConnect)
frmPref.chkReConn.Checked = bReconnect
Next
Dim szStartup As Collection = clsReader.GetConfigInfo("Misc", "Startup", " ", "PirateChat.xml")
Dim getStartup As String
For Each getStartup In szStartup
bStartup = getStartup
frmPref.chkStartup.Checked = getStartup
Next
End Sub
regards,
happy new yrs every 1
from supra
 
if i remove all 3 's nothing.... i will get error.....the problem is
coming from module ....
Sub DisplayMessage(ByVal rtb As RichTextBox, ByVal sText As String,
Optional ByVal Colour As String = "")
rtb.SelectionStart = rtb.Text.Length
rtb.doColor(rtb, sText) <==== this may cause error problem
' rtb.SelectedText = sText <=== if i removed removed and rem
above..this will gave no problem
rtb.SelectionStart = rtb.Text.Length
rtb.ScrollToCaret()
sText = Nothing 'String.Empty
End Sub

i am using irc chat similar to mirc. but everything is working when
connection to various server's networks
what happened is. i connected to undernet server (eu.undernet.org). this
gave me biggest error. but if i connected to irc.webmaster.com or
irc.dal.net.this gave me no problem. but why is this coming from
undernet's servers. but take alook what i got from debug window......
this is undernet server:
Brookville.PA.US.StarLink.Org 001 djanjo2 :Welcome to the Internet Relay
Network djanjo2
Brookville.PA.US.StarLink.Org 002 djanjo2 :Your host is
Brookville.PA.US.StarLink.Org, running version u2.9.32StarLink2.1
Brookville.PA.US.StarLink.Org 372 djanjo2 :-
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.

i did resarch from google and i did double check keyword "NEW". i can do
in vb6, but i am getting visual studio 2005... fully loaded this spring
or summer.
regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top