473,813 Members | 3,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ExecutionEngine Exception -> Code sample that triggers EEE

Hi people,

The code that follows throws an ExecutionEngine Exception. This was written
in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1
(7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program on a
Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb RAM.
The code is a single form that when run throws an ExecutionEngine Exception in
'AddRowsToTable '.

If someone with more knowledge on this matter could help me out, or point it
out to MS.NET developers I'd be grateful. If more information is needed I
will be glad to supply it. Here goes:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace Test_EEE_bug
{
public class Form1 : System.Windows. Forms.Form
{
private DataTable dtSource = new DataTable( "Entries" );
private ArrayList logQueue = null;
private System.Timers.T imer logTimer = null;
private readonly object logLock = new object( );
private System.Threadin g.Thread workerThread = null;
private int counter = 0;

private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
private System.Windows. Forms.DataGridT extBoxColumn dataGridTextBox Column1;
private System.Componen tModel.Containe r components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableH andler( DataRow[] drs );

public Form1()
{
InitializeCompo nent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOn ly = true;
dtSource.Column s.Add( dtColumn );
dataGrid1.SetDa taBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.T imer( );
logTimer.AutoRe set = false;
logTimer.Interv al = 250;
logTimer.Synchr onizingObject = null;
logTimer.Elapse d += new
System.Timers.E lapsedEventHand ler(logTimer_El apsed);
logTimer.Enable d = true;
}

private void OnLoad(object sender, System.EventArg s e)
{
SpawnThread( );
}

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
this.BeginInvok e( new SimpleHandler( SpawnThread ) );
}
}

public void Write( string text )
{
lock( logLock )
logQueue.Add( text );
}

private void logTimer_Elapse d(object sender,
System.Timers.E lapsedEventArgs e)
{
ArrayList writeOutQueue = null;
lock( logLock )
if( logQueue.Count != 0 )
{
writeOutQueue = logQueue;
logQueue = new ArrayList( );
}

if( writeOutQueue == null )
logTimer.Enable d = true;
else
{
ArrayList dataRows = new ArrayList( );

for( int i = 0; i != writeOutQueue.C ount; ++i )
{
DataRow dr1 = dtSource.NewRow ( );
dr1[ "Text" ] = writeOutQueue[ i ];
dataRows.Add( dr1 );
}

BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.Suspe ndLayout( );
dtSource.BeginL oadData( );

foreach( DataRow dr in drs )
dtSource.Rows.A dd( dr );

dtSource.EndLoa dData( );
dataGrid1.Resum eLayout( );

logTimer.Enable d = true;
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.dataGridTa bleStyle1 = new System.Windows. Forms.DataGridT ableStyle();
this.dataGridTe xtBoxColumn1 = new
System.Windows. Forms.DataGridT extBoxColumn();
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. HeaderForeColor = System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. ReadOnly = true;
this.dataGrid1. Size = new System.Drawing. Size(592, 440);
this.dataGrid1. TabIndex = 0;
this.dataGrid1. TableStyles.Add Range(new
System.Windows. Forms.DataGridT ableStyle[] {
this.dataGridTa bleStyle1});
//
// dataGridTableSt yle1
//
this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
System.Windows. Forms.DataGridC olumnStyle[] {

this.dataGridTe xtBoxColumn1});
this.dataGridTa bleStyle1.Heade rForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGridTa bleStyle1.Mappi ngName = "";
this.dataGridTa bleStyle1.ReadO nly = true;
//
// dataGridTextBox Column1
//
this.dataGridTe xtBoxColumn1.Fo rmat = "";
this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
this.dataGridTe xtBoxColumn1.He aderText = "Text";
this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
this.dataGridTe xtBoxColumn1.Re adOnly = true;
this.dataGridTe xtBoxColumn1.Wi dth = 75;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(608, 453);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.OnLoa d);
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
this.ResumeLayo ut(false);
}
#endregion

[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}

Kind regards,
--
Tom Tempelaere.
Nov 17 '05 #1
14 2043
I'll make sure someone sees this.
Thanks.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:81******** *************** ***********@mic rosoft.com...
Hi people,

The code that follows throws an ExecutionEngine Exception. This was written
in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1
(7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program on
a
Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb
RAM.
The code is a single form that when run throws an ExecutionEngine Exception
in
'AddRowsToTable '.

If someone with more knowledge on this matter could help me out, or point
it
out to MS.NET developers I'd be grateful. If more information is needed I
will be glad to supply it. Here goes:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace Test_EEE_bug
{
public class Form1 : System.Windows. Forms.Form
{
private DataTable dtSource = new DataTable( "Entries" );
private ArrayList logQueue = null;
private System.Timers.T imer logTimer = null;
private readonly object logLock = new object( );
private System.Threadin g.Thread workerThread = null;
private int counter = 0;

private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
private System.Windows. Forms.DataGridT extBoxColumn
dataGridTextBox Column1;
private System.Componen tModel.Containe r components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableH andler( DataRow[] drs );

public Form1()
{
InitializeCompo nent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOn ly = true;
dtSource.Column s.Add( dtColumn );
dataGrid1.SetDa taBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.T imer( );
logTimer.AutoRe set = false;
logTimer.Interv al = 250;
logTimer.Synchr onizingObject = null;
logTimer.Elapse d += new
System.Timers.E lapsedEventHand ler(logTimer_El apsed);
logTimer.Enable d = true;
}

private void OnLoad(object sender, System.EventArg s e)
{
SpawnThread( );
}

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
this.BeginInvok e( new SimpleHandler( SpawnThread ) );
}
}

public void Write( string text )
{
lock( logLock )
logQueue.Add( text );
}

private void logTimer_Elapse d(object sender,
System.Timers.E lapsedEventArgs e)
{
ArrayList writeOutQueue = null;
lock( logLock )
if( logQueue.Count != 0 )
{
writeOutQueue = logQueue;
logQueue = new ArrayList( );
}

if( writeOutQueue == null )
logTimer.Enable d = true;
else
{
ArrayList dataRows = new ArrayList( );

for( int i = 0; i != writeOutQueue.C ount; ++i )
{
DataRow dr1 = dtSource.NewRow ( );
dr1[ "Text" ] = writeOutQueue[ i ];
dataRows.Add( dr1 );
}

BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.Suspe ndLayout( );
dtSource.BeginL oadData( );

foreach( DataRow dr in drs )
dtSource.Rows.A dd( dr );

dtSource.EndLoa dData( );
dataGrid1.Resum eLayout( );

logTimer.Enable d = true;
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.dataGridTa bleStyle1 = new
System.Windows. Forms.DataGridT ableStyle();
this.dataGridTe xtBoxColumn1 = new
System.Windows. Forms.DataGridT extBoxColumn();

((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. HeaderForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. ReadOnly = true;
this.dataGrid1. Size = new System.Drawing. Size(592, 440);
this.dataGrid1. TabIndex = 0;
this.dataGrid1. TableStyles.Add Range(new
System.Windows. Forms.DataGridT ableStyle[] {
this.dataGridTa bleStyle1});
//
// dataGridTableSt yle1
//
this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
System.Windows. Forms.DataGridC olumnStyle[] {

this.dataGridTe xtBoxColumn1});
this.dataGridTa bleStyle1.Heade rForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGridTa bleStyle1.Mappi ngName = "";
this.dataGridTa bleStyle1.ReadO nly = true;
//
// dataGridTextBox Column1
//
this.dataGridTe xtBoxColumn1.Fo rmat = "";
this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
this.dataGridTe xtBoxColumn1.He aderText = "Text";
this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
this.dataGridTe xtBoxColumn1.Re adOnly = true;
this.dataGridTe xtBoxColumn1.Wi dth = 75;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(608, 453);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.OnLoa d);
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
this.ResumeLayo ut(false);
}
#endregion

[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}

Kind regards,
--
Tom Tempelaere.

Nov 17 '05 #2
Hi Bob,

After experimenting on other PC's we noticed that on one PC the exception
didn't trigger. We compared them, and noticed that one was running XP/SP2
with .NET 1.1/SP1. I'm going to upgrade the .NET framework and see if this
still occurs, but it looks like it got solved already. I'll test this further
and post my findings...

Thanks & kind regards,
--
Tom Tempelaere.
"Bob Powell [MVP]" wrote:
I'll make sure someone sees this.
Thanks.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:81******** *************** ***********@mic rosoft.com...
Hi people,

The code that follows throws an ExecutionEngine Exception. This was written
in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1
(7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program on
a
Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb
RAM.
The code is a single form that when run throws an ExecutionEngine Exception
in
'AddRowsToTable '.

If someone with more knowledge on this matter could help me out, or point
it
out to MS.NET developers I'd be grateful. If more information is needed I
will be glad to supply it. Here goes:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace Test_EEE_bug
{
public class Form1 : System.Windows. Forms.Form
{
private DataTable dtSource = new DataTable( "Entries" );
private ArrayList logQueue = null;
private System.Timers.T imer logTimer = null;
private readonly object logLock = new object( );
private System.Threadin g.Thread workerThread = null;
private int counter = 0;

private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
private System.Windows. Forms.DataGridT extBoxColumn
dataGridTextBox Column1;
private System.Componen tModel.Containe r components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableH andler( DataRow[] drs );

public Form1()
{
InitializeCompo nent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOn ly = true;
dtSource.Column s.Add( dtColumn );
dataGrid1.SetDa taBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.T imer( );
logTimer.AutoRe set = false;
logTimer.Interv al = 250;
logTimer.Synchr onizingObject = null;
logTimer.Elapse d += new
System.Timers.E lapsedEventHand ler(logTimer_El apsed);
logTimer.Enable d = true;
}

private void OnLoad(object sender, System.EventArg s e)
{
SpawnThread( );
}

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
this.BeginInvok e( new SimpleHandler( SpawnThread ) );
}
}

public void Write( string text )
{
lock( logLock )
logQueue.Add( text );
}

private void logTimer_Elapse d(object sender,
System.Timers.E lapsedEventArgs e)
{
ArrayList writeOutQueue = null;
lock( logLock )
if( logQueue.Count != 0 )
{
writeOutQueue = logQueue;
logQueue = new ArrayList( );
}

if( writeOutQueue == null )
logTimer.Enable d = true;
else
{
ArrayList dataRows = new ArrayList( );

for( int i = 0; i != writeOutQueue.C ount; ++i )
{
DataRow dr1 = dtSource.NewRow ( );
dr1[ "Text" ] = writeOutQueue[ i ];
dataRows.Add( dr1 );
}

BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.Suspe ndLayout( );
dtSource.BeginL oadData( );

foreach( DataRow dr in drs )
dtSource.Rows.A dd( dr );

dtSource.EndLoa dData( );
dataGrid1.Resum eLayout( );

logTimer.Enable d = true;
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.dataGridTa bleStyle1 = new
System.Windows. Forms.DataGridT ableStyle();
this.dataGridTe xtBoxColumn1 = new
System.Windows. Forms.DataGridT extBoxColumn();

((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. HeaderForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. ReadOnly = true;
this.dataGrid1. Size = new System.Drawing. Size(592, 440);
this.dataGrid1. TabIndex = 0;
this.dataGrid1. TableStyles.Add Range(new
System.Windows. Forms.DataGridT ableStyle[] {
this.dataGridTa bleStyle1});
//
// dataGridTableSt yle1
//
this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
System.Windows. Forms.DataGridC olumnStyle[] {

this.dataGridTe xtBoxColumn1});
this.dataGridTa bleStyle1.Heade rForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGridTa bleStyle1.Mappi ngName = "";
this.dataGridTa bleStyle1.ReadO nly = true;
//
// dataGridTextBox Column1
//
this.dataGridTe xtBoxColumn1.Fo rmat = "";
this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
this.dataGridTe xtBoxColumn1.He aderText = "Text";
this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
this.dataGridTe xtBoxColumn1.Re adOnly = true;
this.dataGridTe xtBoxColumn1.Wi dth = 75;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(608, 453);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.OnLoa d);
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
this.ResumeLayo ut(false);
}
#endregion

[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}

Kind regards,
--
Tom Tempelaere.


Nov 17 '05 #3
While checking this to see if I could reproduce the problem using your code
I have generated log entries of many thousands of lines and no EEE so-far.
How many entries do you generate before it crashes?

If I can generate the error I'll escalate it...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:81******** *************** ***********@mic rosoft.com...
Hi people,

The code that follows throws an ExecutionEngine Exception. This was written
in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1
(7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program on
a
Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb
RAM.
The code is a single form that when run throws an ExecutionEngine Exception
in
'AddRowsToTable '.

If someone with more knowledge on this matter could help me out, or point
it
out to MS.NET developers I'd be grateful. If more information is needed I
will be glad to supply it. Here goes:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace Test_EEE_bug
{
public class Form1 : System.Windows. Forms.Form
{
private DataTable dtSource = new DataTable( "Entries" );
private ArrayList logQueue = null;
private System.Timers.T imer logTimer = null;
private readonly object logLock = new object( );
private System.Threadin g.Thread workerThread = null;
private int counter = 0;

private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
private System.Windows. Forms.DataGridT extBoxColumn
dataGridTextBox Column1;
private System.Componen tModel.Containe r components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableH andler( DataRow[] drs );

public Form1()
{
InitializeCompo nent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOn ly = true;
dtSource.Column s.Add( dtColumn );
dataGrid1.SetDa taBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.T imer( );
logTimer.AutoRe set = false;
logTimer.Interv al = 250;
logTimer.Synchr onizingObject = null;
logTimer.Elapse d += new
System.Timers.E lapsedEventHand ler(logTimer_El apsed);
logTimer.Enable d = true;
}

private void OnLoad(object sender, System.EventArg s e)
{
SpawnThread( );
}

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
this.BeginInvok e( new SimpleHandler( SpawnThread ) );
}
}

public void Write( string text )
{
lock( logLock )
logQueue.Add( text );
}

private void logTimer_Elapse d(object sender,
System.Timers.E lapsedEventArgs e)
{
ArrayList writeOutQueue = null;
lock( logLock )
if( logQueue.Count != 0 )
{
writeOutQueue = logQueue;
logQueue = new ArrayList( );
}

if( writeOutQueue == null )
logTimer.Enable d = true;
else
{
ArrayList dataRows = new ArrayList( );

for( int i = 0; i != writeOutQueue.C ount; ++i )
{
DataRow dr1 = dtSource.NewRow ( );
dr1[ "Text" ] = writeOutQueue[ i ];
dataRows.Add( dr1 );
}

BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.Suspe ndLayout( );
dtSource.BeginL oadData( );

foreach( DataRow dr in drs )
dtSource.Rows.A dd( dr );

dtSource.EndLoa dData( );
dataGrid1.Resum eLayout( );

logTimer.Enable d = true;
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.dataGridTa bleStyle1 = new
System.Windows. Forms.DataGridT ableStyle();
this.dataGridTe xtBoxColumn1 = new
System.Windows. Forms.DataGridT extBoxColumn();

((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. HeaderForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. ReadOnly = true;
this.dataGrid1. Size = new System.Drawing. Size(592, 440);
this.dataGrid1. TabIndex = 0;
this.dataGrid1. TableStyles.Add Range(new
System.Windows. Forms.DataGridT ableStyle[] {
this.dataGridTa bleStyle1});
//
// dataGridTableSt yle1
//
this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
System.Windows. Forms.DataGridC olumnStyle[] {

this.dataGridTe xtBoxColumn1});
this.dataGridTa bleStyle1.Heade rForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGridTa bleStyle1.Mappi ngName = "";
this.dataGridTa bleStyle1.ReadO nly = true;
//
// dataGridTextBox Column1
//
this.dataGridTe xtBoxColumn1.Fo rmat = "";
this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
this.dataGridTe xtBoxColumn1.He aderText = "Text";
this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
this.dataGridTe xtBoxColumn1.Re adOnly = true;
this.dataGridTe xtBoxColumn1.Wi dth = 75;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(608, 453);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.OnLoa d);
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
this.ResumeLayo ut(false);
}
#endregion

[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}

Kind regards,
--
Tom Tempelaere.

Nov 17 '05 #4
Ahh, Hi, I saw this after I posted the other reply. Let me know how your
results go. If this is old news we shouldn't worry too much.

Bob.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:F5******** *************** ***********@mic rosoft.com...
Hi Bob,

After experimenting on other PC's we noticed that on one PC the exception
didn't trigger. We compared them, and noticed that one was running XP/SP2
with .NET 1.1/SP1. I'm going to upgrade the .NET framework and see if this
still occurs, but it looks like it got solved already. I'll test this
further
and post my findings...

Thanks & kind regards,
--
Tom Tempelaere.
"Bob Powell [MVP]" wrote:
I'll make sure someone sees this.
Thanks.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81******** *************** ***********@mic rosoft.com...
> Hi people,
>
> The code that follows throws an ExecutionEngine Exception. This was
> written
> in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE
> 7.1
> (7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program
> on
> a
> Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with
> 2Gb
> RAM.
> The code is a single form that when run throws an
> ExecutionEngine Exception
> in
> 'AddRowsToTable '.
>
> If someone with more knowledge on this matter could help me out, or
> point
> it
> out to MS.NET developers I'd be grateful. If more information is needed
> I
> will be glad to supply it. Here goes:
>
> using System;
> using System.Drawing;
> using System.Collecti ons;
> using System.Componen tModel;
> using System.Windows. Forms;
> using System.Data;
>
> namespace Test_EEE_bug
> {
> public class Form1 : System.Windows. Forms.Form
> {
> private DataTable dtSource = new DataTable( "Entries" );
> private ArrayList logQueue = null;
> private System.Timers.T imer logTimer = null;
> private readonly object logLock = new object( );
> private System.Threadin g.Thread workerThread = null;
> private int counter = 0;
>
> private System.Windows. Forms.DataGrid dataGrid1;
> private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
> private System.Windows. Forms.DataGridT extBoxColumn
> dataGridTextBox Column1;
> private System.Componen tModel.Containe r components = null;
>
> private delegate void SimpleHandler( );
> private delegate void AddRowsToTableH andler( DataRow[] drs );
>
> public Form1()
> {
> InitializeCompo nent();
>
> DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
> dtColumn.ReadOn ly = true;
> dtSource.Column s.Add( dtColumn );
> dataGrid1.SetDa taBinding( dtSource, null );
>
> logQueue = new ArrayList( );
>
> logTimer = new System.Timers.T imer( );
> logTimer.AutoRe set = false;
> logTimer.Interv al = 250;
> logTimer.Synchr onizingObject = null;
> logTimer.Elapse d += new
> System.Timers.E lapsedEventHand ler(logTimer_El apsed);
> logTimer.Enable d = true;
> }
>
> private void OnLoad(object sender, System.EventArg s e)
> {
> SpawnThread( );
> }
>
> private void SpawnThread()
> {
> workerThread = new System.Threadin g.Thread( new
> System.Threadin g.ThreadStart( WorkingThread ) );
> workerThread.St art( );
> }
>
> private void WorkingThread( )
> {
> try
> {
> for( int i = 0; i != 8; ++i )
> Write( "Log line " + ++counter );
> }
> finally
> {
> this.BeginInvok e( new SimpleHandler( SpawnThread ) );
> }
> }
>
> public void Write( string text )
> {
> lock( logLock )
> logQueue.Add( text );
> }
>
> private void logTimer_Elapse d(object sender,
> System.Timers.E lapsedEventArgs e)
> {
> ArrayList writeOutQueue = null;
> lock( logLock )
> if( logQueue.Count != 0 )
> {
> writeOutQueue = logQueue;
> logQueue = new ArrayList( );
> }
>
> if( writeOutQueue == null )
> logTimer.Enable d = true;
> else
> {
> ArrayList dataRows = new ArrayList( );
>
> for( int i = 0; i != writeOutQueue.C ount; ++i )
> {
> DataRow dr1 = dtSource.NewRow ( );
> dr1[ "Text" ] = writeOutQueue[ i ];
> dataRows.Add( dr1 );
> }
>
> BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new
> object[]{
> (DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
> }
> }
>
> private void AddRowsToTable( DataRow[] drs )
> {
> dataGrid1.Suspe ndLayout( );
> dtSource.BeginL oadData( );
>
> foreach( DataRow dr in drs )
> dtSource.Rows.A dd( dr );
>
> dtSource.EndLoa dData( );
> dataGrid1.Resum eLayout( );
>
> logTimer.Enable d = true;
> }
>
> protected override void Dispose( bool disposing )
> {
> if( disposing )
> {
> if (components != null)
> {
> components.Disp ose();
> }
> }
> base.Dispose( disposing );
> }
>
> #region Windows Form Designer generated code
> private void InitializeCompo nent()
> {
> this.dataGrid1 = new System.Windows. Forms.DataGrid( );
> this.dataGridTa bleStyle1 = new
> System.Windows. Forms.DataGridT ableStyle();
> this.dataGridTe xtBoxColumn1 = new
> System.Windows. Forms.DataGridT extBoxColumn();
>
> ((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
> this.SuspendLay out();
> //
> // dataGrid1
> //
> this.dataGrid1. DataMember = "";
> this.dataGrid1. HeaderForeColor =
> System.Drawing. SystemColors.Co ntrolText;
> this.dataGrid1. Location = new System.Drawing. Point(8, 8);
> this.dataGrid1. Name = "dataGrid1" ;
> this.dataGrid1. ReadOnly = true;
> this.dataGrid1. Size = new System.Drawing. Size(592, 440);
> this.dataGrid1. TabIndex = 0;
> this.dataGrid1. TableStyles.Add Range(new
> System.Windows. Forms.DataGridT ableStyle[] {
> this.dataGridTa bleStyle1});
> //
> // dataGridTableSt yle1
> //
> this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
> this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
> System.Windows. Forms.DataGridC olumnStyle[] {
>
> this.dataGridTe xtBoxColumn1});
> this.dataGridTa bleStyle1.Heade rForeColor =
> System.Drawing. SystemColors.Co ntrolText;
> this.dataGridTa bleStyle1.Mappi ngName = "";
> this.dataGridTa bleStyle1.ReadO nly = true;
> //
> // dataGridTextBox Column1
> //
> this.dataGridTe xtBoxColumn1.Fo rmat = "";
> this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
> this.dataGridTe xtBoxColumn1.He aderText = "Text";
> this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
> this.dataGridTe xtBoxColumn1.Re adOnly = true;
> this.dataGridTe xtBoxColumn1.Wi dth = 75;
> //
> // Form1
> //
> this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
> this.ClientSize = new System.Drawing. Size(608, 453);
> this.Controls.A dd(this.dataGri d1);
> this.Name = "Form1";
> this.Text = "Form1";
> this.Load += new System.EventHan dler(this.OnLoa d);
>
> ((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
> this.ResumeLayo ut(false);
> }
> #endregion
>
> [STAThread]
> static void Main()
> {
> Application.Run (new Form1());
> }
> }
> }
>
> Kind regards,
> --
> Tom Tempelaere.


Nov 17 '05 #5
Hi Bob,

Good news, I downloaded and installed .NET 1.1/SP1 and it solved the
problem. Honestly I was not aware that there was a SP1 for .NET 1.1. I find
it weird that the version number did not increase. I wonder, is SP1 for .NET
1.1 automatically installed with XP/SP2?

Kind regards,
--
Tom Tempelaere.
"Bob Powell [MVP]" wrote:
Ahh, Hi, I saw this after I posted the other reply. Let me know how your
results go. If this is old news we shouldn't worry too much.

Bob.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:F5******** *************** ***********@mic rosoft.com...
Hi Bob,

After experimenting on other PC's we noticed that on one PC the exception
didn't trigger. We compared them, and noticed that one was running XP/SP2
with .NET 1.1/SP1. I'm going to upgrade the .NET framework and see if this
still occurs, but it looks like it got solved already. I'll test this
further
and post my findings...

Thanks & kind regards,
--
Tom Tempelaere.
"Bob Powell [MVP]" wrote:
I'll make sure someone sees this.
Thanks.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81******** *************** ***********@mic rosoft.com...
> Hi people,
>
> The code that follows throws an ExecutionEngine Exception. This was
> written
> in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE
> 7.1
> (7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program
> on
> a
> Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with
> 2Gb
> RAM.
> The code is a single form that when run throws an
> ExecutionEngine Exception
> in
> 'AddRowsToTable '.
>
> If someone with more knowledge on this matter could help me out, or
> point
> it
> out to MS.NET developers I'd be grateful. If more information is needed
> I
> will be glad to supply it. Here goes:
>
> using System;
> using System.Drawing;
> using System.Collecti ons;
> using System.Componen tModel;
> using System.Windows. Forms;
> using System.Data;
>
> namespace Test_EEE_bug
> {
> public class Form1 : System.Windows. Forms.Form
> {
> private DataTable dtSource = new DataTable( "Entries" );
> private ArrayList logQueue = null;
> private System.Timers.T imer logTimer = null;
> private readonly object logLock = new object( );
> private System.Threadin g.Thread workerThread = null;
> private int counter = 0;
>
> private System.Windows. Forms.DataGrid dataGrid1;
> private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
> private System.Windows. Forms.DataGridT extBoxColumn
> dataGridTextBox Column1;
> private System.Componen tModel.Containe r components = null;
>
> private delegate void SimpleHandler( );
> private delegate void AddRowsToTableH andler( DataRow[] drs );
>
> public Form1()
> {
> InitializeCompo nent();
>
> DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
> dtColumn.ReadOn ly = true;
> dtSource.Column s.Add( dtColumn );
> dataGrid1.SetDa taBinding( dtSource, null );
>
> logQueue = new ArrayList( );
>
> logTimer = new System.Timers.T imer( );
> logTimer.AutoRe set = false;
> logTimer.Interv al = 250;
> logTimer.Synchr onizingObject = null;
> logTimer.Elapse d += new
> System.Timers.E lapsedEventHand ler(logTimer_El apsed);
> logTimer.Enable d = true;
> }
>
> private void OnLoad(object sender, System.EventArg s e)
> {
> SpawnThread( );
> }
>
> private void SpawnThread()
> {
> workerThread = new System.Threadin g.Thread( new
> System.Threadin g.ThreadStart( WorkingThread ) );
> workerThread.St art( );
> }
>
> private void WorkingThread( )
> {
> try
> {
> for( int i = 0; i != 8; ++i )
> Write( "Log line " + ++counter );
> }
> finally
> {
> this.BeginInvok e( new SimpleHandler( SpawnThread ) );
> }
> }
>
> public void Write( string text )
> {
> lock( logLock )
> logQueue.Add( text );
> }
>
> private void logTimer_Elapse d(object sender,
> System.Timers.E lapsedEventArgs e)
> {
> ArrayList writeOutQueue = null;
> lock( logLock )
> if( logQueue.Count != 0 )
> {
> writeOutQueue = logQueue;
> logQueue = new ArrayList( );
> }
>
> if( writeOutQueue == null )
> logTimer.Enable d = true;
> else
> {
> ArrayList dataRows = new ArrayList( );
>
> for( int i = 0; i != writeOutQueue.C ount; ++i )
> {
> DataRow dr1 = dtSource.NewRow ( );
> dr1[ "Text" ] = writeOutQueue[ i ];
> dataRows.Add( dr1 );
> }
>
> BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new
> object[]{
> (DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
> }
> }
>
> private void AddRowsToTable( DataRow[] drs )
> {
> dataGrid1.Suspe ndLayout( );
> dtSource.BeginL oadData( );
>
> foreach( DataRow dr in drs )
> dtSource.Rows.A dd( dr );
>
> dtSource.EndLoa dData( );
> dataGrid1.Resum eLayout( );
>
> logTimer.Enable d = true;
> }
>
> protected override void Dispose( bool disposing )
> {
> if( disposing )
> {
> if (components != null)
> {
> components.Disp ose();
> }
> }
> base.Dispose( disposing );
> }
>
> #region Windows Form Designer generated code
> private void InitializeCompo nent()
> {
> this.dataGrid1 = new System.Windows. Forms.DataGrid( );
> this.dataGridTa bleStyle1 = new
> System.Windows. Forms.DataGridT ableStyle();
> this.dataGridTe xtBoxColumn1 = new
> System.Windows. Forms.DataGridT extBoxColumn();
>
> ((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
> this.SuspendLay out();
> //
> // dataGrid1
> //
> this.dataGrid1. DataMember = "";
> this.dataGrid1. HeaderForeColor =
> System.Drawing. SystemColors.Co ntrolText;
> this.dataGrid1. Location = new System.Drawing. Point(8, 8);
> this.dataGrid1. Name = "dataGrid1" ;
> this.dataGrid1. ReadOnly = true;
> this.dataGrid1. Size = new System.Drawing. Size(592, 440);
> this.dataGrid1. TabIndex = 0;
> this.dataGrid1. TableStyles.Add Range(new
> System.Windows. Forms.DataGridT ableStyle[] {
> this.dataGridTa bleStyle1});
> //
> // dataGridTableSt yle1
> //
> this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
> this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
> System.Windows. Forms.DataGridC olumnStyle[] {
>
> this.dataGridTe xtBoxColumn1});
> this.dataGridTa bleStyle1.Heade rForeColor =
> System.Drawing. SystemColors.Co ntrolText;
> this.dataGridTa bleStyle1.Mappi ngName = "";
> this.dataGridTa bleStyle1.ReadO nly = true;
> //
> // dataGridTextBox Column1
> //
> this.dataGridTe xtBoxColumn1.Fo rmat = "";
> this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
> this.dataGridTe xtBoxColumn1.He aderText = "Text";
> this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
> this.dataGridTe xtBoxColumn1.Re adOnly = true;
> this.dataGridTe xtBoxColumn1.Wi dth = 75;
> //
> // Form1
> //
> this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
> this.ClientSize = new System.Drawing. Size(608, 453);
> this.Controls.A dd(this.dataGri d1);
> this.Name = "Form1";
> this.Text = "Form1";
> this.Load += new System.EventHan dler(this.OnLoa d);
>
> ((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
> this.ResumeLayo ut(false);
> }
> #endregion
>
> [STAThread]
> static void Main()
> {
> Application.Run (new Form1());
> }
> }
> }
>
> Kind regards,
> --
> Tom Tempelaere.

Nov 17 '05 #6
Tom, Bob,
How did you manage to run this?
Running this program using v2.0 of the framework doesn't even get a chance
to paint the initial grid, on v1.1 the initial grid is painted but after
that the UI gets non respondive so I can't even scroll. (note both are run
on a very fast system).

The reason is simple, this:

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
BeginInvoke( new SimpleHandler( SpawnThread ) );
}
}

is respawning a thread at such a high rate that it saturates the CPU, more
,the SpawnThread function is marshaled to the UI thread, so it posts
messages at such a high rate that the essage queue overflows, input and
paint messages don't even get a chance to be picked up in a timely fashion
or are completely lost.
And... it deadlocks when run on a dual proc.

Question to Tom, is this sample illustrative for your program design?

Willy.
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:u4******** ******@TK2MSFTN GP11.phx.gbl...
While checking this to see if I could reproduce the problem using your
code I have generated log entries of many thousands of lines and no EEE
so-far. How many entries do you generate before it crashes?

If I can generate the error I'll escalate it...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81******** *************** ***********@mic rosoft.com...
Hi people,

The code that follows throws an ExecutionEngine Exception. This was
written
in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1
(7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program on
a
Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb
RAM.
The code is a single form that when run throws an
ExecutionEngine Exception in
'AddRowsToTable '.

If someone with more knowledge on this matter could help me out, or point
it
out to MS.NET developers I'd be grateful. If more information is needed I
will be glad to supply it. Here goes:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace Test_EEE_bug
{
public class Form1 : System.Windows. Forms.Form
{
private DataTable dtSource = new DataTable( "Entries" );
private ArrayList logQueue = null;
private System.Timers.T imer logTimer = null;
private readonly object logLock = new object( );
private System.Threadin g.Thread workerThread = null;
private int counter = 0;

private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
private System.Windows. Forms.DataGridT extBoxColumn
dataGridTextBox Column1;
private System.Componen tModel.Containe r components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableH andler( DataRow[] drs );

public Form1()
{
InitializeCompo nent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOn ly = true;
dtSource.Column s.Add( dtColumn );
dataGrid1.SetDa taBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.T imer( );
logTimer.AutoRe set = false;
logTimer.Interv al = 250;
logTimer.Synchr onizingObject = null;
logTimer.Elapse d += new
System.Timers.E lapsedEventHand ler(logTimer_El apsed);
logTimer.Enable d = true;
}

private void OnLoad(object sender, System.EventArg s e)
{
SpawnThread( );
}

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
this.BeginInvok e( new SimpleHandler( SpawnThread ) );
}
}

public void Write( string text )
{
lock( logLock )
logQueue.Add( text );
}

private void logTimer_Elapse d(object sender,
System.Timers.E lapsedEventArgs e)
{
ArrayList writeOutQueue = null;
lock( logLock )
if( logQueue.Count != 0 )
{
writeOutQueue = logQueue;
logQueue = new ArrayList( );
}

if( writeOutQueue == null )
logTimer.Enable d = true;
else
{
ArrayList dataRows = new ArrayList( );

for( int i = 0; i != writeOutQueue.C ount; ++i )
{
DataRow dr1 = dtSource.NewRow ( );
dr1[ "Text" ] = writeOutQueue[ i ];
dataRows.Add( dr1 );
}

BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new
object[]{
(DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.Suspe ndLayout( );
dtSource.BeginL oadData( );

foreach( DataRow dr in drs )
dtSource.Rows.A dd( dr );

dtSource.EndLoa dData( );
dataGrid1.Resum eLayout( );

logTimer.Enable d = true;
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.dataGridTa bleStyle1 = new
System.Windows. Forms.DataGridT ableStyle();
this.dataGridTe xtBoxColumn1 = new
System.Windows. Forms.DataGridT extBoxColumn();

((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. HeaderForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. ReadOnly = true;
this.dataGrid1. Size = new System.Drawing. Size(592, 440);
this.dataGrid1. TabIndex = 0;
this.dataGrid1. TableStyles.Add Range(new
System.Windows. Forms.DataGridT ableStyle[] {
this.dataGridTa bleStyle1});
//
// dataGridTableSt yle1
//
this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
System.Windows. Forms.DataGridC olumnStyle[] {

this.dataGridTe xtBoxColumn1});
this.dataGridTa bleStyle1.Heade rForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGridTa bleStyle1.Mappi ngName = "";
this.dataGridTa bleStyle1.ReadO nly = true;
//
// dataGridTextBox Column1
//
this.dataGridTe xtBoxColumn1.Fo rmat = "";
this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
this.dataGridTe xtBoxColumn1.He aderText = "Text";
this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
this.dataGridTe xtBoxColumn1.Re adOnly = true;
this.dataGridTe xtBoxColumn1.Wi dth = 75;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(608, 453);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.OnLoa d);
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
this.ResumeLayo ut(false);
}
#endregion

[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}

Kind regards,
--
Tom Tempelaere.


Nov 17 '05 #7
Hi Willy,

The UI is semi-reponsive but of course this snippet isn't representative for
the program I am writing. With semi-responsive I mean that UI interaction is
veeery slow, but I notice that the screen is still updated. After about 30000
lines, it gets even slower but still there is some response. After some more
waiting the program becomes nearly unresponsive but I notice that the UI is
still updated.

I just tried to make a program that triggered the ExecutionEngine Exception
and it did for .NET 1.1 without SP1. I didn't bother to write something that
made real sense.

The 'spawned' thread is actually a placeholder for the main thread in my
application. It is not supposed to finish as quick as the thread I wrote in
this test program. But in some circumstances it can terminate and then this
thread should be restarted.

What bothers me though is the deadlock situation you mention on dual
processor system. Would this be because the UI message queue is overflowing?
Does it still deadlock when you put a Sleep before invoking the SpawnThread?
There is only one 'lock'-object in the test program and I don't think that
can cause a deadlock situation... Perhaps this test-program stresses the
OS/framework to its limits?

Thanks for the input, and kind regards,
--
Tom Tempelaere.

"Willy Denoyette [MVP]" wrote:
Tom, Bob,
How did you manage to run this?
Running this program using v2.0 of the framework doesn't even get a chance
to paint the initial grid, on v1.1 the initial grid is painted but after
that the UI gets non respondive so I can't even scroll. (note both are run
on a very fast system).

The reason is simple, this:

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
BeginInvoke( new SimpleHandler( SpawnThread ) );
}
}

is respawning a thread at such a high rate that it saturates the CPU, more
,the SpawnThread function is marshaled to the UI thread, so it posts
messages at such a high rate that the essage queue overflows, input and
paint messages don't even get a chance to be picked up in a timely fashion
or are completely lost.
And... it deadlocks when run on a dual proc.

Question to Tom, is this sample illustrative for your program design?

Willy.
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:u4******** ******@TK2MSFTN GP11.phx.gbl...
While checking this to see if I could reproduce the problem using your
code I have generated log entries of many thousands of lines and no EEE
so-far. How many entries do you generate before it crashes?

If I can generate the error I'll escalate it...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81******** *************** ***********@mic rosoft.com...
Hi people,

The code that follows throws an ExecutionEngine Exception. This was
written
in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE 7.1
(7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program on
a
Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb
RAM.
The code is a single form that when run throws an
ExecutionEngine Exception in
'AddRowsToTable '.

If someone with more knowledge on this matter could help me out, or point
it
out to MS.NET developers I'd be grateful. If more information is needed I
will be glad to supply it. Here goes:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace Test_EEE_bug
{
public class Form1 : System.Windows. Forms.Form
{
private DataTable dtSource = new DataTable( "Entries" );
private ArrayList logQueue = null;
private System.Timers.T imer logTimer = null;
private readonly object logLock = new object( );
private System.Threadin g.Thread workerThread = null;
private int counter = 0;

private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
private System.Windows. Forms.DataGridT extBoxColumn
dataGridTextBox Column1;
private System.Componen tModel.Containe r components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableH andler( DataRow[] drs );

public Form1()
{
InitializeCompo nent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOn ly = true;
dtSource.Column s.Add( dtColumn );
dataGrid1.SetDa taBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.T imer( );
logTimer.AutoRe set = false;
logTimer.Interv al = 250;
logTimer.Synchr onizingObject = null;
logTimer.Elapse d += new
System.Timers.E lapsedEventHand ler(logTimer_El apsed);
logTimer.Enable d = true;
}

private void OnLoad(object sender, System.EventArg s e)
{
SpawnThread( );
}

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
this.BeginInvok e( new SimpleHandler( SpawnThread ) );
}
}

public void Write( string text )
{
lock( logLock )
logQueue.Add( text );
}

private void logTimer_Elapse d(object sender,
System.Timers.E lapsedEventArgs e)
{
ArrayList writeOutQueue = null;
lock( logLock )
if( logQueue.Count != 0 )
{
writeOutQueue = logQueue;
logQueue = new ArrayList( );
}

if( writeOutQueue == null )
logTimer.Enable d = true;
else
{
ArrayList dataRows = new ArrayList( );

for( int i = 0; i != writeOutQueue.C ount; ++i )
{
DataRow dr1 = dtSource.NewRow ( );
dr1[ "Text" ] = writeOutQueue[ i ];
dataRows.Add( dr1 );
}

BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new
object[]{
(DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.Suspe ndLayout( );
dtSource.BeginL oadData( );

foreach( DataRow dr in drs )
dtSource.Rows.A dd( dr );

dtSource.EndLoa dData( );
dataGrid1.Resum eLayout( );

logTimer.Enable d = true;
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.dataGridTa bleStyle1 = new
System.Windows. Forms.DataGridT ableStyle();
this.dataGridTe xtBoxColumn1 = new
System.Windows. Forms.DataGridT extBoxColumn();

((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. HeaderForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. ReadOnly = true;
this.dataGrid1. Size = new System.Drawing. Size(592, 440);
this.dataGrid1. TabIndex = 0;
this.dataGrid1. TableStyles.Add Range(new
System.Windows. Forms.DataGridT ableStyle[] {
this.dataGridTa bleStyle1});
//
// dataGridTableSt yle1
//
this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
System.Windows. Forms.DataGridC olumnStyle[] {

this.dataGridTe xtBoxColumn1});
this.dataGridTa bleStyle1.Heade rForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGridTa bleStyle1.Mappi ngName = "";
this.dataGridTa bleStyle1.ReadO nly = true;
//
// dataGridTextBox Column1
//
this.dataGridTe xtBoxColumn1.Fo rmat = "";
this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
this.dataGridTe xtBoxColumn1.He aderText = "Text";
this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
this.dataGridTe xtBoxColumn1.Re adOnly = true;
this.dataGridTe xtBoxColumn1.Wi dth = 75;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(608, 453);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.OnLoa d);
((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
this.ResumeLayo ut(false);
}
#endregion

[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}

Kind regards,
--
Tom Tempelaere.



Nov 17 '05 #8

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:0A******** *************** ***********@mic rosoft.com...
Hi Willy,

The UI is semi-reponsive but of course this snippet isn't representative
for
the program I am writing. With semi-responsive I mean that UI interaction
is
veeery slow, but I notice that the screen is still updated. After about
30000
lines, it gets even slower but still there is some response. After some
more
waiting the program becomes nearly unresponsive but I notice that the UI
is
still updated.

It is 'semi responsive' when I run this on a slower system, but it's not
responsive at all when I ran this on a fast system, moreover it dealocks on
a dual proc athlon. The point is that the message queue overflows before the
first paint message on a fast system, anyway your problems is due to the
fact that the UI thread is flooded with messages to create new Threads and
because that code (your SpawnThread() function
) runs on the UI thread.
I just tried to make a program that triggered the ExecutionEngine Exception
and it did for .NET 1.1 without SP1. I didn't bother to write something
that
made real sense.

The 'spawned' thread is actually a placeholder for the main thread in my
application. It is not supposed to finish as quick as the thread I wrote
in
this test program. But in some circumstances it can terminate and then
this
thread should be restarted.

What bothers me though is the deadlock situation you mention on dual
processor system. Would this be because the UI message queue is
overflowing?
Does it still deadlock when you put a Sleep before invoking the
SpawnThread?
No, it doesn't deadlock with a sleep call. But I can't debug this stuff,
because when I start this from the debugger it doesn't deadlock.
There is only one 'lock'-object in the test program and I don't think that
can cause a deadlock situation... Perhaps this test-program stresses the
OS/framework to its limits?


Yes, your problem is two fold and related , you create threads at a too high
rate and you post messages (the marshaled calls to the UI thread) at such
high rate that the windows queue probably overflows (not sure though) before
the first paint message arrives. This is really something you won't do in a
real world application do you?
Willy.
Nov 17 '05 #9
It ran fine for me but I'm running a productionn machine with .NET 1.1 on
board. All my 2.0 setups are on VM's

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Willy Denoyette [MVP]" <wi************ *@telenet.be> wrote in message
news:eP******** ******@tk2msftn gp13.phx.gbl...
Tom, Bob,
How did you manage to run this?
Running this program using v2.0 of the framework doesn't even get a chance
to paint the initial grid, on v1.1 the initial grid is painted but after
that the UI gets non respondive so I can't even scroll. (note both are run
on a very fast system).

The reason is simple, this:

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
BeginInvoke( new SimpleHandler( SpawnThread ) );
}
}

is respawning a thread at such a high rate that it saturates the CPU, more
,the SpawnThread function is marshaled to the UI thread, so it posts
messages at such a high rate that the essage queue overflows, input and
paint messages don't even get a chance to be picked up in a timely fashion
or are completely lost.
And... it deadlocks when run on a dual proc.

Question to Tom, is this sample illustrative for your program design?

Willy.
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:u4******** ******@TK2MSFTN GP11.phx.gbl...
While checking this to see if I could reproduce the problem using your
code I have generated log entries of many thousands of lines and no EEE
so-far. How many entries do you generate before it crashes?

If I can generate the error I'll escalate it...

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81******** *************** ***********@mic rosoft.com...
Hi people,

The code that follows throws an ExecutionEngine Exception. This was
written
in C# (Microsoft Visual C# .NET 69462-335-0000007-18823) using MSDE
7.1
(7.1.3088). The framework is .NET 1.1 (1.1.4322). I tested the program
on a
Windows XP Professional/SP1, with a Pentium 4/2.6Ghz processor, with 2Gb
RAM.
The code is a single form that when run throws an
ExecutionEngine Exception in
'AddRowsToTable '.

If someone with more knowledge on this matter could help me out, or
point it
out to MS.NET developers I'd be grateful. If more information is needed
I
will be glad to supply it. Here goes:

using System;
using System.Drawing;
using System.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;

namespace Test_EEE_bug
{
public class Form1 : System.Windows. Forms.Form
{
private DataTable dtSource = new DataTable( "Entries" );
private ArrayList logQueue = null;
private System.Timers.T imer logTimer = null;
private readonly object logLock = new object( );
private System.Threadin g.Thread workerThread = null;
private int counter = 0;

private System.Windows. Forms.DataGrid dataGrid1;
private System.Windows. Forms.DataGridT ableStyle dataGridTableSt yle1;
private System.Windows. Forms.DataGridT extBoxColumn
dataGridTextBox Column1;
private System.Componen tModel.Containe r components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableH andler( DataRow[] drs );

public Form1()
{
InitializeCompo nent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOn ly = true;
dtSource.Column s.Add( dtColumn );
dataGrid1.SetDa taBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.T imer( );
logTimer.AutoRe set = false;
logTimer.Interv al = 250;
logTimer.Synchr onizingObject = null;
logTimer.Elapse d += new
System.Timers.E lapsedEventHand ler(logTimer_El apsed);
logTimer.Enable d = true;
}

private void OnLoad(object sender, System.EventArg s e)
{
SpawnThread( );
}

private void SpawnThread()
{
workerThread = new System.Threadin g.Thread( new
System.Threadin g.ThreadStart( WorkingThread ) );
workerThread.St art( );
}

private void WorkingThread( )
{
try
{
for( int i = 0; i != 8; ++i )
Write( "Log line " + ++counter );
}
finally
{
this.BeginInvok e( new SimpleHandler( SpawnThread ) );
}
}

public void Write( string text )
{
lock( logLock )
logQueue.Add( text );
}

private void logTimer_Elapse d(object sender,
System.Timers.E lapsedEventArgs e)
{
ArrayList writeOutQueue = null;
lock( logLock )
if( logQueue.Count != 0 )
{
writeOutQueue = logQueue;
logQueue = new ArrayList( );
}

if( writeOutQueue == null )
logTimer.Enable d = true;
else
{
ArrayList dataRows = new ArrayList( );

for( int i = 0; i != writeOutQueue.C ount; ++i )
{
DataRow dr1 = dtSource.NewRow ( );
dr1[ "Text" ] = writeOutQueue[ i ];
dataRows.Add( dr1 );
}

BeginInvoke( new AddRowsToTableH andler( AddRowsToTable ), new
object[]{
(DataRow[]) dataRows.ToArra y( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.Suspe ndLayout( );
dtSource.BeginL oadData( );

foreach( DataRow dr in drs )
dtSource.Rows.A dd( dr );

dtSource.EndLoa dData( );
dataGrid1.Resum eLayout( );

logTimer.Enable d = true;
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
private void InitializeCompo nent()
{
this.dataGrid1 = new System.Windows. Forms.DataGrid( );
this.dataGridTa bleStyle1 = new
System.Windows. Forms.DataGridT ableStyle();
this.dataGridTe xtBoxColumn1 = new
System.Windows. Forms.DataGridT extBoxColumn();

((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .BeginInit();
this.SuspendLay out();
//
// dataGrid1
//
this.dataGrid1. DataMember = "";
this.dataGrid1. HeaderForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGrid1. Location = new System.Drawing. Point(8, 8);
this.dataGrid1. Name = "dataGrid1" ;
this.dataGrid1. ReadOnly = true;
this.dataGrid1. Size = new System.Drawing. Size(592, 440);
this.dataGrid1. TabIndex = 0;
this.dataGrid1. TableStyles.Add Range(new
System.Windows. Forms.DataGridT ableStyle[] {
this.dataGridTa bleStyle1});
//
// dataGridTableSt yle1
//
this.dataGridTa bleStyle1.DataG rid = this.dataGrid1;
this.dataGridTa bleStyle1.GridC olumnStyles.Add Range(new
System.Windows. Forms.DataGridC olumnStyle[] {

this.dataGridTe xtBoxColumn1});
this.dataGridTa bleStyle1.Heade rForeColor =
System.Drawing. SystemColors.Co ntrolText;
this.dataGridTa bleStyle1.Mappi ngName = "";
this.dataGridTa bleStyle1.ReadO nly = true;
//
// dataGridTextBox Column1
//
this.dataGridTe xtBoxColumn1.Fo rmat = "";
this.dataGridTe xtBoxColumn1.Fo rmatInfo = null;
this.dataGridTe xtBoxColumn1.He aderText = "Text";
this.dataGridTe xtBoxColumn1.Ma ppingName = "Text";
this.dataGridTe xtBoxColumn1.Re adOnly = true;
this.dataGridTe xtBoxColumn1.Wi dth = 75;
//
// Form1
//
this.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(608, 453);
this.Controls.A dd(this.dataGri d1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHan dler(this.OnLoa d);

((System.Compon entModel.ISuppo rtInitialize)(t his.dataGrid1)) .EndInit();
this.ResumeLayo ut(false);
}
#endregion

[STAThread]
static void Main()
{
Application.Run (new Form1());
}
}
}

Kind regards,
--
Tom Tempelaere.



Nov 17 '05 #10

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

Similar topics

0
1342
by: SC | last post by:
I have an application written in VB.Net. It uses a dll to talk to an external device. Initially, it was all written in one thread, and it worked fine. I need to take readings from the external device at regular intervals, so now when the application loads, I create a thread that just loops and reads, sleeps. However, once I make the application multithreaded, the non-reading thread exits all the time with no apparent reason. It...
0
1384
by: Benjamin Stutz | last post by:
Hello, if I try to call my function: public static string GetDisplayNameFromPidl(IntPtr Pidl) { SHFILEINFOBYTE fileinfobyte = new SHFILEINFOBYTE(true); try { SHGetFileInfoPidl(
0
1224
by: Henrik Dahl | last post by:
Hello! Approx. a year ago we made a Smart Client application. It worked perfectly. Then some customers have begun to install .NET Framework 1.1 instead of .NET Framework 1.0 and suddenly the specific exception System.ExecutionEngineException is thrown quite often. The exception is ONLY thrown when the program is run as a Smart Client, i.e. by starting it from a URL pointing to a www server. I think there is an error in the Internet...
1
7149
by: Tim Mulholland | last post by:
I have an application that uses an external C(?) Dll and it seems like after I make a specific call to that dll the application will crash at a random call to the dll in the future. It sometimes crashes the next call after said call, while sometimes it doesn't crash for 5 minutes; but it always crashes. As long as I don't call tira_get_captured_data it doesn't crash so I am assuming that is the cause. I get a...
0
999
by: Henrik Dahl | last post by:
Hello! There have been numerous articles about situations where a client emits an ExecutionEngineException, but only when it is no touch deployed, i.e. started by a URL and so on. Until now, to my best knowledge, there has been no fix for this. Is it something we and our customers just have to get used to or will it be fixed? Best regards,
1
2063
by: Thomas Albrecht | last post by:
My application fails during initialization of the dlls with an ExecutionEngineException and a access violation in the MFC app. The structure of the program looks like: MFC app -> mixed DLL -> managed DLL (C#) Because the exception/access violation occures during startup none of my breakpoints are reached. I disabled the access to the DLL step by step and
13
5586
by: MD | last post by:
I have been converting a program from VB6 to VB.Net and enhancing it as well. All has been progressing OK although its been hard work. Now, all of a sudden, when I try to execute a ShowDialog() on one of my forms I get "An unhandled exception of type 'System.ExecutionEngineException' occurred in system.windows.forms.dll". I can't work out what has caused this, and can't find any help on the Microsoft site or anywhere else on the web. ...
0
1027
by: Franck | last post by:
Hi, I'm taking control over an XLS Spreadsheet in my WebService. Got a class with an Excel.Application Object which I initiate. At random time, I get a System.ExecutionEngineException error when trying to read the property which return me the Excel Application ! public class ExcelHost private xlApp as Object
3
3770
by: NormD | last post by:
An exception 'System.ExecutionEngineException' has occurred in servername I have deployed a windows application on a server; I'm running the same on my pc using http://servername/myApps/myApp.exe. myApp.exe contains some third party controls used to display data in a grid and to print a preview of the data. I am getting the above listed error when I attempt to preview/print a DevExpress GridControl using the DevExpress printing control. A...
3
11608
by: Stephen Flynn | last post by:
If I run my program on another machine I get the following error An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Data.dll This happens with I try to open an OleDb.OleDbConnection What is causing this? Also the normal Try Catch block doesn't catch this error, I had to use the
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
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
10667
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
10407
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...
0
10139
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
6897
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
5705
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3885
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.