473,837 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.NullRefe renceException

I am doing some of the C# walkthroughs to transition from
VB to C#. When I try to execute

static void Main()
{
Aplication.Run( new Form1())
}

I raise a 'System.NullRef erenceException " in
system.windows. forms.dll

I am sure this is a simple fix, but I cannot find a answer.

Terrence
Jul 19 '05 #1
3 9150
Can you post the rest of your code? Without it, it's difficult to tell
what's going on....

Thanks,
- bliz
--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.
--------------------
Content-Class: urn:content-classes:message
From: "Terrence" <tr********@hot mail.com>
Sender: "Terrence" <tr********@hot mail.com>
Subject: System.NullRefe renceException
Date: Wed, 2 Jul 2003 20:14:49 -0700
Lines: 14
Message-ID: <08************ *************** *@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcNBEUNX0JWNsBA cSKah7zscfgzN3g ==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.publi c.dotnet.genera l
Path: cpmsftngxa09.ph x.gbl
Xref: cpmsftngxa09.ph x.gbl microsoft.publi c.dotnet.genera l:14499
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

I am doing some of the C# walkthroughs to transition from
VB to C#. When I try to execute

static void Main()
{
Aplication.Run (new Form1())
}

I raise a 'System.NullRef erenceException " in
system.windows .forms.dll

I am sure this is a simple fix, but I cannot find a answer.

Terrence


Jul 19 '05 #2
Thanks for posting the code. It appears as though there's a bug in the
InitializeCompo nent method. You may want to take a look at the book
publisher's or author's web site to see if there's some erratta information
with corrections to the code.

Unfortunately I can't tell what's going on without even more information
regarding external references to things such as
AuthorsWinClien t.localhost.aut hors1

Good luck!
-bliz

--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.
--------------------
Content-Class: urn:content-classes:message
From: "Terrence" <tr********@hot mail.com>
Sender: "Terrence" <tr********@hot mail.com>
References: <08************ *************** *@phx.gbl> <zH************ *@cpmsftngxa09. phx.gbl>Subject: RE: System.NullRefe renceException
Date: Thu, 3 Jul 2003 07:10:32 -0700
Lines: 319
Message-ID: <0c************ *************** *@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNBbN3Ax2+BDkE pRLCp7Qep1YyJAw ==
Newsgroups: microsoft.publi c.dotnet.genera l
Path: cpmsftngxa09.ph x.gbl
Xref: cpmsftngxa09.ph x.gbl microsoft.publi c.dotnet.genera l:14548
NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

Here is the code; I will mark the line where the execution
stops with <====

Also, I have included the contents of the Debug window
following the code.
============== ============== CODE =============== =======
using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace AuthorsWinClien t
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frmMain : System.Windows. Forms.Form
{
private System.Windows. Forms.DataGrid
dataGrid1;
private System.Windows. Forms.Button
SaveData;
private System.Windows. Forms.Button
LoadData;
private
AuthorsWinClie nt.localhost.au thors1 AuthorData;
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.Containe r
components = null;

public frmMain()
{
//
// Required for Windows Form
Designer support
//
InitializeCompo nent();

//
// TODO: Add any constructor code
after InitializeCompo nent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool
disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose
();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated
code
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeCompo nent()
{
this.dataGrid1 = new
System.Windows .Forms.DataGrid ();
this.AuthorData = new
AuthorsWinClie nt.localhost.au thors1();
this.SaveData = new
System.Windows .Forms.Button() ;
this.LoadData = new
System.Windows .Forms.Button() ;

((System.Compon entModel.ISuppo rtInitialize)
(this.dataGrid 1)).BeginInit() ;

((System.Compon entModel.ISuppo rtInitialize)
(this.AuthorDa ta)).BeginInit( );
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember
= "authors";
this.dataGrid1. DataSource =
this.AuthorDat a;
this.dataGrid1. HeaderForeColor =
System.Drawing .SystemColors.C ontrolText;
this.dataGrid1. Location = new
System.Drawing .Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. Size = new
System.Drawing .Size(344, 184);
this.dataGrid1. TabIndex = 0;
//
// AuthorData
//
this.AuthorData .DataSetName
= "authors1";
this.AuthorData .Locale = new
System.Globali zation.CultureI nfo("en-US");
//
// SaveData
//
this.SaveData.L ocation = new
System.Drawing .Point(216, 208);
this.SaveData.N ame = "SaveData";
this.SaveData.S ize = new
System.Drawing .Size(96, 24);
this.SaveData.T abIndex = 1;
this.SaveData.T ext = "Save";
this.SaveData.C lick += new
System.EventHa ndler(this.Save Data_Click);
//
// LoadData
//
this.LoadData.L ocation = new
System.Drawing .Point(40, 208);
this.LoadData.N ame = "LoadData";
this.LoadData.S ize = new
System.Drawing .Size(80, 24);
this.LoadData.T abIndex = 2;
this.LoadData.T ext = "Load";
this.LoadData.C lick += new
System.EventHa ndler(this.Load Data_Click);
//
// frmMain
//
this.AutoScaleB aseSize = new
System.Drawing .Size(5, 13);
this.ClientSize = new
System.Drawing .Size(360, 245);
this.Controls.A dd(this.LoadDat a);
this.Controls.A dd(this.SaveDat a);
this.Controls.A dd(this.dataGri d1);
this.Name = "frmMain";
this.Text = "Form Main";

((System.Compon entModel.ISuppo rtInitialize)
(this.dataGrid 1)).EndInit();

((System.Compon entModel.ISuppo rtInitialize)
(this.AuthorDa ta)).EndInit();
this.ResumeLayo ut(false);

}
#endregion

/// <summary>
/// The main entry point for the
application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run (new frmMain());
} <==== Exception Thrown

private void LoadData_Click( object sender,
System.EventAr gs e)
{

AuthorsWinClien t.localhost.Aut horsService ws =
new
AuthorsWinClie nt.localhost.Au thorsService();
ws.Credentials =
System.Net.Cre dentialCache.De faultCredential s;
AuthorData.Merg e(ws.GetAuthors ());
}

private void SaveData_Click( object sender,
System.EventAr gs e)
{

AuthorsWinClien t.localhost.Aut horsService ws =
new
AuthorsWinClie nt.localhost.Au thorsService();
ws.Credentials =
System.Net.Cre dentialCache.De faultCredential s;

AuthorsWinClien t.localhost.aut hors1 diffAuthors =
new
AuthorsWinClie nt.localhost.au thors1();
diffAuthors.Mer ge
(AuthorData.Ge tChanges());
diffAuthors = ws.UpdateAuthor s
(diffAuthors );
AuthorData.Merg e(diffAuthors);
}
}
}
============== ========= DEBUG =============== ===========
'DefaultDomain ':
Loaded 'c:\winnt\micro soft.net\framew ork\v1.1.4322
\mscorlib.dll' , No symbols loaded.
'AuthorsWinCli ent': Loaded 'C:\Documents and
Settings\tdani el\My Documents\Visua l Studio
Projects\Autho rWebService\Aut horsWinClient\b in\Debug\Author
sWinClient.exe ', Symbols loaded.
'AuthorsWinCli ent.exe':
Loaded 'c:\winnt\assem bly\gac\system. windows.forms\1 .0.5000
.0__b77a5c5619 34e089\system.w indows.forms.dl l', No symbols
loaded.
'AuthorsWinCli ent.exe':
Loaded 'c:\winnt\assem bly\gac\system\ 1.0.5000.0__b77 a5c5619
34e089\system. dll', No symbols loaded.
'AuthorsWinCli ent.exe':
Loaded 'c:\winnt\assem bly\gac\system. drawing\1.0.500 0.0__b0
3f5f7f11d50a3a \system.drawing .dll', No symbols loaded.
'AuthorsWinCli ent.exe':
Loaded 'c:\winnt\assem bly\gac\system. data\1.0.5000.0 __b77a5
c561934e089\sy stem.data.dll', No symbols loaded.
'AuthorsWinCli ent.exe':
Loaded 'c:\winnt\assem bly\gac\system. xml\1.0.5000.0_ _b77a5c
561934e089\sys tem.xml.dll', No symbols loaded.
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.
Unhandled Exception: System.NullRefe renceException: Object
reference not set to an instance of an object.
at System.Windows. Forms.SafeNativ eMethods.ShowWi ndow
(HandleRef hWnd, Int32 nCmdShow)
at System.Windows. Forms.Control.S etVisibleCore(B oolean
value)
at System.Windows. Forms.Form.SetV isibleCore(Bool ean
value)
at System.Windows. Forms.Control.s et_Visible(Bool ean
value)
at
System.Windows .Forms.ThreadCo ntext.RunMessag eLoopInner
(Int32 reason, ApplicationCont ext context)
at System.Windows. Forms.ThreadCon text.RunMessage Loop
(Int32 reason, ApplicationCont ext context)
at System.Windows. Forms.Applicati on.Run(Form mainForm)
at AuthorsWinClien t.frmMain.Main( ) in c:\documents and
settings\tdani el\my documents\visua l studio
projects\autho rwebservice\aut horswinclient\f orm1.cs:line
121The program '[3084] AuthorsWinClien t.exe' has exited
with code 0 (0x0).

-----Original Message-----
Can you post the rest of your code? Without it, it's

difficult to tell
what's going on....

Thanks,
- bliz
--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and

confers no rights.
Please reply to newsgroups only, so that others may

benefit. Thanks.


--------------------
Content-Class: urn:content-classes:message
From: "Terrence" <tr********@hot mail.com>
Sender: "Terrence" <tr********@hot mail.com>
Subject: System.NullRefe renceException
Date: Wed, 2 Jul 2003 20:14:49 -0700
Lines: 14
Message-ID: <08************ *************** *@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcNBEUNX0JWNsBA cSKah7zscfgzN3g ==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups : microsoft.publi c.dotnet.genera l
Path: cpmsftngxa09.ph x.gbl
Xref: cpmsftngxa09.ph x.gblmicrosoft.publ ic.dotnet.gener al:14499NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

I am doing some of the C# walkthroughs to transitionfromVB to C#. When I try to execute

static void Main()
{
Aplication.R un(new Form1())
}

I raise a 'System.NullRef erenceException " in
system.windo ws.forms.dll

I am sure this is a simple fix, but I cannot find aanswer.
Terrence


.


Jul 19 '05 #3
Let me take a look at the sample app.

Thanks,
- bliz
--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only, so that others may benefit. Thanks.
--------------------
Content-Class: urn:content-classes:message
From: "Terrence" <tr********@hot mail.com>
Sender: "Terrence" <tr********@hot mail.com>
References: <08************ *************** *@phx.gbl> <zH************ *@cpmsftngxa09. phx.gbl>
<0c************ *************** *@phx.gbl>
<X4************ **@cpmsftngxa09 .phx.gbl>Subject: RE: System.NullRefe renceException
Date: Thu, 3 Jul 2003 08:01:12 -0700
Lines: 397
Message-ID: <50************ *************** *@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Thread-Index: AcNBc/GGEtBG3tHWTS2AU 6Ql41txxg==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.publi c.dotnet.genera l
Path: cpmsftngxa09.ph x.gbl
Xref: cpmsftngxa09.ph x.gbl microsoft.publi c.dotnet.genera l:14562
NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

Jim,

This is the code from MS VS.NET 2003 documentation/C#
Walkthrough/Simple Distributed App - Typed verbatim. I
have done the same walkthrough using VS.NET (on home box)
and it ran. Any thoughts?
-----Original Message-----
Thanks for posting the code. It appears as though

there's a bug in the
InitializeCom ponent method. You may want to take a look

at the book
publisher's or author's web site to see if there's some

erratta information
with corrections to the code.

Unfortunate ly I can't tell what's going on without even

more information
regarding external references to things such as
AuthorsWinCli ent.localhost.a uthors1

Good luck!
-bliz

--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties, and

confers no rights.
Please reply to newsgroups only, so that others may

benefit. Thanks.


--------------------
Content-Class: urn:content-classes:message
From: "Terrence" <tr********@hot mail.com>
Sender: "Terrence" <tr********@hot mail.com>
References : <08************ *************** *@phx.gbl>

<zH********** ***@cpmsftngxa0 9.phx.gbl>
Subject: RE: System.NullRefe renceException
Date: Thu, 3 Jul 2003 07:10:32 -0700
Lines: 319
Message-ID: <0c************ *************** *@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcNBbN3Ax2+BDkE pRLCp7Qep1YyJAw ==
Newsgroups : microsoft.publi c.dotnet.genera l
Path: cpmsftngxa09.ph x.gbl
Xref: cpmsftngxa09.ph x.gblmicrosoft.publ ic.dotnet.gener al:14548NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

Here is the code; I will mark the line where theexecutionstops with <====

Also, I have included the contents of the Debug window
following the code.
============ =============== = CODE =============== =======
using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace AuthorsWinClien t
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class frmMain : System.Windows. Forms.Form
{
private System.Windows. Forms.DataGrid
dataGrid1;
private System.Windows. Forms.Button
SaveData;
private System.Windows. Forms.Button
LoadData;
private
AuthorsWinCl ient.localhost. authors1 AuthorData;
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.Containe r
components = null;

public frmMain()
{
//
// Required for Windows Form
Designer support
//
InitializeCompo nent();

//
// TODO: Add any constructor code
after InitializeCompo nent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool
disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose
();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated
code
/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeCompo nent()
{
this.dataGrid1 = new
System.Windo ws.Forms.DataGr id();
this.AuthorData = new
AuthorsWinCl ient.localhost. authors1();
this.SaveData = new
System.Windo ws.Forms.Button ();
this.LoadData = new
System.Windo ws.Forms.Button ();

((System.Compon entModel.ISuppo rtInitialize)
(this.dataGr id1)).BeginInit ();

((System.Compon entModel.ISuppo rtInitialize)
(this.Author Data)).BeginIni t();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember
= "authors";
this.dataGrid1. DataSource =
this.AuthorD ata;
this.dataGrid1. HeaderForeColor =
System.Drawi ng.SystemColors .ControlText;
this.dataGrid1. Location = new
System.Drawi ng.Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. Size = new
System.Drawi ng.Size(344, 184);
this.dataGrid1. TabIndex = 0;
//
// AuthorData
//
this.AuthorData .DataSetName
= "authors1";
this.AuthorData .Locale = new
System.Globa lization.Cultur eInfo("en-US");
//
// SaveData
//
this.SaveData.L ocation = new
System.Drawi ng.Point(216, 208);
this.SaveData.N ame = "SaveData";
this.SaveData.S ize = new
System.Drawi ng.Size(96, 24);
this.SaveData.T abIndex = 1;
this.SaveData.T ext = "Save";
this.SaveData.C lick += new
System.Event Handler(this.Sa veData_Click);
//
// LoadData
//
this.LoadData.L ocation = new
System.Drawi ng.Point(40, 208);
this.LoadData.N ame = "LoadData";
this.LoadData.S ize = new
System.Drawi ng.Size(80, 24);
this.LoadData.T abIndex = 2;
this.LoadData.T ext = "Load";
this.LoadData.C lick += new
System.Event Handler(this.Lo adData_Click);
//
// frmMain
//
this.AutoScaleB aseSize = new
System.Drawi ng.Size(5, 13);
this.ClientSize = new
System.Drawi ng.Size(360, 245);
this.Controls.A dd(this.LoadDat a);
this.Controls.A dd(this.SaveDat a);
this.Controls.A dd(this.dataGri d1);
this.Name = "frmMain";
this.Text = "Form Main";

((System.Compon entModel.ISuppo rtInitialize)
(this.dataGr id1)).EndInit() ;

((System.Compon entModel.ISuppo rtInitialize)
(this.Author Data)).EndInit( );
this.ResumeLayo ut(false);

}
#endregion

/// <summary>
/// The main entry point for the
applicatio n.
/// </summary>
[STAThread]
static void Main()
{
Application.Run (new frmMain());
} <==== Exception Thrown

private void LoadData_Click( object sender,
System.Event Args e)
{

AuthorsWinClien t.localhost.Aut horsService ws =
new
AuthorsWinCl ient.localhost. AuthorsService( );
ws.Credentials =
System.Net.C redentialCache. DefaultCredenti als;
AuthorData.Merg e(ws.GetAuthors ());
}

private void SaveData_Click( object sender,
System.Event Args e)
{

AuthorsWinClien t.localhost.Aut horsService ws =
new
AuthorsWinCl ient.localhost. AuthorsService( );
ws.Credentials =
System.Net.C redentialCache. DefaultCredenti als;

AuthorsWinClien t.localhost.aut hors1 diffAuthors =
new
AuthorsWinCl ient.localhost. authors1();
diffAuthors.Mer ge
(AuthorData. GetChanges());
diffAuthors = ws.UpdateAuthor s
(diffAuthors );
AuthorData.Merg e(diffAuthors);
}
}
}
============ =========== DEBUG =============== ===========
'DefaultDoma in':
Loaded 'c:\winnt\micro soft.net\framew ork\v1.1.4322
\mscorlib.dl l', No symbols loaded.
'AuthorsWinC lient': Loaded 'C:\Documents and
Settings\tda niel\My Documents\Visua l Studio
Projects\Aut horWebService\A uthorsWinClient \bin\Debug\AuthorsWinClient.e xe', Symbols loaded.
'AuthorsWinC lient.exe':
Loaded 'c:\winnt\assem bly\gac\system. windows.forms\1 .0.5000.0__b77a5c56 1934e089\system .windows.forms. dll', Nosymbolsloaded.
'AuthorsWinC lient.exe':
Loaded 'c:\winnt\assem bly\gac\system\ 1.0.5000.0__b77 a5c561934e089\syste m.dll', No symbols loaded.
'AuthorsWinC lient.exe':
Loaded 'c:\winnt\assem bly\gac\system. drawing\1.0.500 0.0__b03f5f7f11d50a 3a\system.drawi ng.dll', No symbols loaded.
'AuthorsWinC lient.exe':
Loaded 'c:\winnt\assem bly\gac\system. data\1.0.5000.0 __b77a5c561934e089\ system.data.dll ', No symbols loaded.
'AuthorsWinC lient.exe':
Loaded 'c:\winnt\assem bly\gac\system. xml\1.0.5000.0_ _b77a5c561934e089\s ystem.xml.dll', No symbols loaded.
An unhandled exception of
type 'System.NullRef erenceException ' occurred in
system.windo ws.forms.dll

Additional information: Object reference not set to an
instance of an object.
Unhandled Exception: System.NullRefe renceException:Objectreference not set to an instance of an object.
at System.Windows. Forms.SafeNativ eMethods.ShowWi ndow
(HandleRef hWnd, Int32 nCmdShow)
at System.Windows. Forms.Control.S etVisibleCore(Booleanvalue)
at System.Windows. Forms.Form.SetV isibleCore(Bool ean
value)
at System.Windows. Forms.Control.s et_Visible(Bool ean
value)
at
System.Windo ws.Forms.Thread Context.RunMess ageLoopInner
(Int32 reason, ApplicationCont ext context)
at System.Windows. Forms.ThreadCon text.RunMessage Loop
(Int32 reason, ApplicationCont ext context)
at System.Windows. Forms.Applicati on.Run(Form mainForm)
at AuthorsWinClien t.frmMain.Main( ) in c:\documentsandsettings\tda niel\my documents\visua l studio
projects\aut horwebservice\a uthorswinclient \form1.cs:line
121The program '[3084] AuthorsWinClien t.exe' has exited
with code 0 (0x0).
-----Original Message-----
Can you post the rest of your code? Without it, it's
difficult to tell
what's going on....

Thanks,
- bliz
--
Jim Blizzard
Sr .NET Developer Evangelist
Microsoft

Your Potential. Our Passion.

This posting is provided "AS IS" with no warranties,andconfers no rights.
Please reply to newsgroups only, so that others may
benefit. Thanks.
--------------------
>Content-Class: urn:content-classes:message
>From: "Terrence" <tr********@hot mail.com>
>Sender: "Terrence" <tr********@hot mail.com>
>Subject: System.NullRefe renceException
>Date: Wed, 2 Jul 2003 20:14:49 -0700
>Lines: 14
>Message-ID: <08************ *************** *@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Thread-Index: AcNBEUNX0JWNsBA cSKah7zscfgzN3g ==
>X-MimeOLE: Produced By Microsoft MimeOLEV5.50.4910.030 0>Newsgroups : microsoft.publi c.dotnet.genera l
>Path: cpmsftngxa09.ph x.gbl
>Xref: cpmsftngxa09.ph x.gbl
microsoft.pu blic.dotnet.gen eral:14499
>NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
>X-Tomcat-NG: microsoft.publi c.dotnet.genera l
>
>I am doing some of the C# walkthroughs to transition
from
>VB to C#. When I try to execute
>
>static void Main()
>{
>Aplication .Run(new Form1())
>}
>
>I raise a 'System.NullRef erenceException " in
>system.win dows.forms.dll
>
>I am sure this is a simple fix, but I cannot find a
answer.
>
>Terrence
>

.


.


Jul 19 '05 #4

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

Similar topics

1
536
by: Rafael | last post by:
Hi, I hope I can find some help for this problem IDE: Visual Studio.NET 2003 Developer Editio Language: C# Problem: "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. Visual Studio's IDE is not allowing me to develop projects in C#... I've trying to create a simple Windows Forms project using Visual Studio.NET...
3
397
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in system.windows.forms.dll
0
9784
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520" AutoPostBackOnNodeMove="false" DragAndDropEnabled="true" NodeEditingEnabled="False" KeyboardEnabled="true" CssClass="TreeView" NodeCssClass="TreeNode" SelectedNodeCssClass="SelectedTreeNode" HoverNodeCssClass="HoverTreeNode" NodeEditCssClass="NodeEdit"
0
2696
by: Matthias Kwiedor | last post by:
Hi! I want to create a WebBrowser Control at runtime. So i ported the "at start creation" of the Control to a new routine. Everything works fine, but i implement the BeforeNavigateFix and a own Content Menu. For this i need this lines: public void create_new_browser()
2
7857
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item in treeview i display the content item in axWebBrowser, i close the sub form normally when i close the main the following error is generated An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll ...
1
4104
by: msnews.microsoft.com | last post by:
I'm trying to fill an array of objects but when I add the first object I get a NullReferenceException. ---------------------------------------------------------------------------- ------------------------------------------- Public Class TestClass Public NextSubIndex As Integer = 1 Public arrTestSubClass() As TestSubClass
2
2784
by: sxiao | last post by:
Hi, there I got a NullReferenceException when there are more than one users trying to open the same page at the same time. The senerio is: Two users logged into the web application using the Windows domain user account and tried to open the same page which has the databasde query code. When the two user tried to open the same page at the same time, there is a runtime error messsage showing as follows:
6
22232
by: William Mild | last post by:
I must be getting brain fried. I can't see the error. Create a new web form with the following code begind: Public Class test Inherits System.Web.UI.Page Public Class ReportCardData Public Structure Attend Dim DaysTardy As Double
3
3666
by: Alex J. | last post by:
I just started to learn C# (my background is in C++), and right now I study the sockets, TCP/IP etc... so, I found a usefull source code at: http://www.codeguru.com/Csharp/Csharp/cs_network/sockets/article.php/c8781/. But there is a scenarion that throw a strange exception. So, the client is connected to the server, I send a message from client to server and viceversa and than I stop the server from the 'x' button from the right-up corner;...
0
9685
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10886
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...
0
10580
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7817
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
7007
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
5674
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
5853
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4479
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
2
4052
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.