472,374 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

System.NullReferenceException

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

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

Terrence
Jul 19 '05 #1
3 8895
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********@hotmail.com>
Sender: "Terrence" <tr********@hotmail.com>
Subject: System.NullReferenceException
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: AcNBEUNX0JWNsBAcSKah7zscfgzN3g==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa09.phx.gbl
Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.general:14499
NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.general

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

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
InitializeComponent 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
AuthorsWinClient.localhost.authors1

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********@hotmail.com>
Sender: "Terrence" <tr********@hotmail.com>
References: <08****************************@phx.gbl> <zH*************@cpmsftngxa09.phx.gbl>Subject: RE: System.NullReferenceException
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+BDkEpRLCp7Qep1YyJAw==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa09.phx.gbl
Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.general:14548
NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.public.dotnet.general

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.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace AuthorsWinClient
{
/// <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
AuthorsWinClient.localhost.authors1 AuthorData;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container
components = null;

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

//
// TODO: Add any constructor code
after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool
disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose
();
}
}
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 InitializeComponent()
{
this.dataGrid1 = new
System.Windows.Forms.DataGrid();
this.AuthorData = new
AuthorsWinClient.localhost.authors1();
this.SaveData = new
System.Windows.Forms.Button();
this.LoadData = new
System.Windows.Forms.Button();

((System.ComponentModel.ISupportInitialize)
(this.dataGrid1)).BeginInit();

((System.ComponentModel.ISupportInitialize)
(this.AuthorData)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember
= "authors";
this.dataGrid1.DataSource =
this.AuthorData;
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.Globalization.CultureInfo("en-US");
//
// SaveData
//
this.SaveData.Location = new
System.Drawing.Point(216, 208);
this.SaveData.Name = "SaveData";
this.SaveData.Size = new
System.Drawing.Size(96, 24);
this.SaveData.TabIndex = 1;
this.SaveData.Text = "Save";
this.SaveData.Click += new
System.EventHandler(this.SaveData_Click);
//
// LoadData
//
this.LoadData.Location = new
System.Drawing.Point(40, 208);
this.LoadData.Name = "LoadData";
this.LoadData.Size = new
System.Drawing.Size(80, 24);
this.LoadData.TabIndex = 2;
this.LoadData.Text = "Load";
this.LoadData.Click += new
System.EventHandler(this.LoadData_Click);
//
// frmMain
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.ClientSize = new
System.Drawing.Size(360, 245);
this.Controls.Add(this.LoadData);
this.Controls.Add(this.SaveData);
this.Controls.Add(this.dataGrid1);
this.Name = "frmMain";
this.Text = "Form Main";

((System.ComponentModel.ISupportInitialize)
(this.dataGrid1)).EndInit();

((System.ComponentModel.ISupportInitialize)
(this.AuthorData)).EndInit();
this.ResumeLayout(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.EventArgs e)
{

AuthorsWinClient.localhost.AuthorsService ws =
new
AuthorsWinClient.localhost.AuthorsService();
ws.Credentials =
System.Net.CredentialCache.DefaultCredentials;
AuthorData.Merge(ws.GetAuthors());
}

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

AuthorsWinClient.localhost.AuthorsService ws =
new
AuthorsWinClient.localhost.AuthorsService();
ws.Credentials =
System.Net.CredentialCache.DefaultCredentials;

AuthorsWinClient.localhost.authors1 diffAuthors =
new
AuthorsWinClient.localhost.authors1();
diffAuthors.Merge
(AuthorData.GetChanges());
diffAuthors = ws.UpdateAuthors
(diffAuthors);
AuthorData.Merge(diffAuthors);
}
}
}
======================= DEBUG ==========================
'DefaultDomain':
Loaded 'c:\winnt\microsoft.net\framework\v1.1.4322
\mscorlib.dll', No symbols loaded.
'AuthorsWinClient': Loaded 'C:\Documents and
Settings\tdaniel\My Documents\Visual Studio
Projects\AuthorWebService\AuthorsWinClient\bin\De bug\Author
sWinClient.exe', Symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.windows.forms\1.0.50 00
.0__b77a5c561934e089\system.windows.forms.dll', No symbols
loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c56 19
34e089\system.dll', No symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.drawing\1.0.5000.0__ b0
3f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.data\1.0.5000.0__b77 a5
c561934e089\system.data.dll', No symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a 5c
561934e089\system.xml.dll', No symbols loaded.
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.
Unhandled Exception: System.NullReferenceException: Object
reference not set to an instance of an object.
at System.Windows.Forms.SafeNativeMethods.ShowWindow
(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolea n
value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean
value)
at System.Windows.Forms.Control.set_Visible(Boolean
value)
at
System.Windows.Forms.ThreadContext.RunMessageLoop Inner
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at AuthorsWinClient.frmMain.Main() in c:\documents and
settings\tdaniel\my documents\visual studio
projects\authorwebservice\authorswinclient\form1. cs:line
121The program '[3084] AuthorsWinClient.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********@hotmail.com>
Sender: "Terrence" <tr********@hotmail.com>
Subject: System.NullReferenceException
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: AcNBEUNX0JWNsBAcSKah7zscfgzN3g==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa09.phx.gbl
Xref: cpmsftngxa09.phx.gblmicrosoft.public.dotnet.general:14499NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
X-Tomcat-NG: microsoft.public.dotnet.general

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

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

I raise a 'System.NullReferenceException" in
system.windows.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********@hotmail.com>
Sender: "Terrence" <tr********@hotmail.com>
References: <08****************************@phx.gbl> <zH*************@cpmsftngxa09.phx.gbl>
<0c****************************@phx.gbl>
<X4**************@cpmsftngxa09.phx.gbl>Subject: RE: System.NullReferenceException
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/GGEtBG3tHWTS2AU6Ql41txxg==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa09.phx.gbl
Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.general:14562
NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
X-Tomcat-NG: microsoft.public.dotnet.general

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
InitializeComponent 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
AuthorsWinClient.localhost.authors1

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********@hotmail.com>
Sender: "Terrence" <tr********@hotmail.com>
References: <08****************************@phx.gbl>

<zH*************@cpmsftngxa09.phx.gbl>
Subject: RE: System.NullReferenceException
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+BDkEpRLCp7Qep1YyJAw==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa09.phx.gbl
Xref: cpmsftngxa09.phx.gblmicrosoft.public.dotnet.general:14548NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
X-Tomcat-NG: microsoft.public.dotnet.general

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.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace AuthorsWinClient
{
/// <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
AuthorsWinClient.localhost.authors1 AuthorData;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container
components = null;

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

//
// TODO: Add any constructor code
after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool
disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose
();
}
}
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 InitializeComponent()
{
this.dataGrid1 = new
System.Windows.Forms.DataGrid();
this.AuthorData = new
AuthorsWinClient.localhost.authors1();
this.SaveData = new
System.Windows.Forms.Button();
this.LoadData = new
System.Windows.Forms.Button();

((System.ComponentModel.ISupportInitialize)
(this.dataGrid1)).BeginInit();

((System.ComponentModel.ISupportInitialize)
(this.AuthorData)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember
= "authors";
this.dataGrid1.DataSource =
this.AuthorData;
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.Globalization.CultureInfo("en-US");
//
// SaveData
//
this.SaveData.Location = new
System.Drawing.Point(216, 208);
this.SaveData.Name = "SaveData";
this.SaveData.Size = new
System.Drawing.Size(96, 24);
this.SaveData.TabIndex = 1;
this.SaveData.Text = "Save";
this.SaveData.Click += new
System.EventHandler(this.SaveData_Click);
//
// LoadData
//
this.LoadData.Location = new
System.Drawing.Point(40, 208);
this.LoadData.Name = "LoadData";
this.LoadData.Size = new
System.Drawing.Size(80, 24);
this.LoadData.TabIndex = 2;
this.LoadData.Text = "Load";
this.LoadData.Click += new
System.EventHandler(this.LoadData_Click);
//
// frmMain
//
this.AutoScaleBaseSize = new
System.Drawing.Size(5, 13);
this.ClientSize = new
System.Drawing.Size(360, 245);
this.Controls.Add(this.LoadData);
this.Controls.Add(this.SaveData);
this.Controls.Add(this.dataGrid1);
this.Name = "frmMain";
this.Text = "Form Main";

((System.ComponentModel.ISupportInitialize)
(this.dataGrid1)).EndInit();

((System.ComponentModel.ISupportInitialize)
(this.AuthorData)).EndInit();
this.ResumeLayout(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.EventArgs e)
{

AuthorsWinClient.localhost.AuthorsService ws =
new
AuthorsWinClient.localhost.AuthorsService();
ws.Credentials =
System.Net.CredentialCache.DefaultCredentials ;
AuthorData.Merge(ws.GetAuthors());
}

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

AuthorsWinClient.localhost.AuthorsService ws =
new
AuthorsWinClient.localhost.AuthorsService();
ws.Credentials =
System.Net.CredentialCache.DefaultCredentials ;

AuthorsWinClient.localhost.authors1 diffAuthors =
new
AuthorsWinClient.localhost.authors1();
diffAuthors.Merge
(AuthorData.GetChanges());
diffAuthors = ws.UpdateAuthors
(diffAuthors);
AuthorData.Merge(diffAuthors);
}
}
}
======================= DEBUG ==========================
'DefaultDomain':
Loaded 'c:\winnt\microsoft.net\framework\v1.1.4322
\mscorlib.dll', No symbols loaded.
'AuthorsWinClient': Loaded 'C:\Documents and
Settings\tdaniel\My Documents\Visual Studio
Projects\AuthorWebService\AuthorsWinClient\bin\ Debug\AuthorsWinClient.exe', Symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.windows.forms\1.0.5000.0__b77a5c561934e089\system.windows.forms.dll ', Nosymbolsloaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll', No symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll', No symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll', No symbols loaded.
'AuthorsWinClient.exe':
Loaded 'c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll', No symbols loaded.
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.
Unhandled Exception: System.NullReferenceException:Objectreference not set to an instance of an object.
at System.Windows.Forms.SafeNativeMethods.ShowWindow
(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Booleanvalue)
at System.Windows.Forms.Form.SetVisibleCore(Boolean
value)
at System.Windows.Forms.Control.set_Visible(Boolean
value)
at
System.Windows.Forms.ThreadContext.RunMessageLo opInner
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at AuthorsWinClient.frmMain.Main() in c:\documentsandsettings\tdaniel\my documents\visual studio
projects\authorwebservice\authorswinclient\form 1.cs:line
121The program '[3084] AuthorsWinClient.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********@hotmail.com>
>Sender: "Terrence" <tr********@hotmail.com>
>Subject: System.NullReferenceException
>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: AcNBEUNX0JWNsBAcSKah7zscfgzN3g==
>X-MimeOLE: Produced By Microsoft MimeOLEV5.50.4910.0300>Newsgroups: microsoft.public.dotnet.general
>Path: cpmsftngxa09.phx.gbl
>Xref: cpmsftngxa09.phx.gbl
microsoft.public.dotnet.general:14499
>NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
>X-Tomcat-NG: microsoft.public.dotnet.general
>
>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
>
>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
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...
3
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...
0
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"...
0
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...
2
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...
1
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. ----------------------------------------------------------------------------...
2
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...
6
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 ...
3
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:...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.