473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

ExecutionEngineException -> Code sample that triggers EEE

Hi people,

The code that follows throws an ExecutionEngineException. 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 ExecutionEngineException 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.Collections;
using System.ComponentModel;
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.Timer logTimer = null;
private readonly object logLock = new object( );
private System.Threading.Thread workerThread = null;
private int counter = 0;

private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn dataGridTextBoxColumn1;
private System.ComponentModel.Container components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableHandler( DataRow[] drs );

public Form1()
{
InitializeComponent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOnly = true;
dtSource.Columns.Add( dtColumn );
dataGrid1.SetDataBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.Timer( );
logTimer.AutoReset = false;
logTimer.Interval = 250;
logTimer.SynchronizingObject = null;
logTimer.Elapsed += new
System.Timers.ElapsedEventHandler(logTimer_Elapsed );
logTimer.Enabled = true;
}

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

private void SpawnThread()
{
workerThread = new System.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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

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

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

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

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

BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.SuspendLayout( );
dtSource.BeginLoadData( );

foreach( DataRow dr in drs )
dtSource.Rows.Add( dr );

dtSource.EndLoadData( );
dataGrid1.ResumeLayout( );

logTimer.Enabled = true;
}

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

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
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.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange (new
System.Windows.Forms.DataGridColumnStyle[] {

this.dataGridTextBoxColumn1});
this.dataGridTableStyle1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "Text";
this.dataGridTextBoxColumn1.MappingName = "Text";
this.dataGridTextBoxColumn1.ReadOnly = true;
this.dataGridTextBoxColumn1.Width = 75;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 453);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion

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

Kind regards,
--
Tom Tempelaere.
Nov 17 '05 #1
14 1988
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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:81**********************************@microsof t.com...
Hi people,

The code that follows throws an ExecutionEngineException. 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 ExecutionEngineException
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.Collections;
using System.ComponentModel;
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.Timer logTimer = null;
private readonly object logLock = new object( );
private System.Threading.Thread workerThread = null;
private int counter = 0;

private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn
dataGridTextBoxColumn1;
private System.ComponentModel.Container components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableHandler( DataRow[] drs );

public Form1()
{
InitializeComponent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOnly = true;
dtSource.Columns.Add( dtColumn );
dataGrid1.SetDataBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.Timer( );
logTimer.AutoReset = false;
logTimer.Interval = 250;
logTimer.SynchronizingObject = null;
logTimer.Elapsed += new
System.Timers.ElapsedEventHandler(logTimer_Elapsed );
logTimer.Enabled = true;
}

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

private void SpawnThread()
{
workerThread = new System.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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

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

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

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

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

BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.SuspendLayout( );
dtSource.BeginLoadData( );

foreach( DataRow dr in drs )
dtSource.Rows.Add( dr );

dtSource.EndLoadData( );
dataGrid1.ResumeLayout( );

logTimer.Enabled = true;
}

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

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new
System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange (new
System.Windows.Forms.DataGridColumnStyle[] {

this.dataGridTextBoxColumn1});
this.dataGridTableStyle1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "Text";
this.dataGridTextBoxColumn1.MappingName = "Text";
this.dataGridTextBoxColumn1.ReadOnly = true;
this.dataGridTextBoxColumn1.Width = 75;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 453);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:81**********************************@microsof t.com...
Hi people,

The code that follows throws an ExecutionEngineException. 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 ExecutionEngineException
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.Collections;
using System.ComponentModel;
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.Timer logTimer = null;
private readonly object logLock = new object( );
private System.Threading.Thread workerThread = null;
private int counter = 0;

private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn
dataGridTextBoxColumn1;
private System.ComponentModel.Container components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableHandler( DataRow[] drs );

public Form1()
{
InitializeComponent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOnly = true;
dtSource.Columns.Add( dtColumn );
dataGrid1.SetDataBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.Timer( );
logTimer.AutoReset = false;
logTimer.Interval = 250;
logTimer.SynchronizingObject = null;
logTimer.Elapsed += new
System.Timers.ElapsedEventHandler(logTimer_Elapsed );
logTimer.Enabled = true;
}

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

private void SpawnThread()
{
workerThread = new System.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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

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

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

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

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

BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.SuspendLayout( );
dtSource.BeginLoadData( );

foreach( DataRow dr in drs )
dtSource.Rows.Add( dr );

dtSource.EndLoadData( );
dataGrid1.ResumeLayout( );

logTimer.Enabled = true;
}

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

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new
System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange (new
System.Windows.Forms.DataGridColumnStyle[] {

this.dataGridTextBoxColumn1});
this.dataGridTableStyle1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "Text";
this.dataGridTextBoxColumn1.MappingName = "Text";
this.dataGridTextBoxColumn1.ReadOnly = true;
this.dataGridTextBoxColumn1.Width = 75;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 453);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:81**********************************@microsof t.com...
Hi people,

The code that follows throws an ExecutionEngineException. 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 ExecutionEngineException
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.Collections;
using System.ComponentModel;
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.Timer logTimer = null;
private readonly object logLock = new object( );
private System.Threading.Thread workerThread = null;
private int counter = 0;

private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn
dataGridTextBoxColumn1;
private System.ComponentModel.Container components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableHandler( DataRow[] drs );

public Form1()
{
InitializeComponent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOnly = true;
dtSource.Columns.Add( dtColumn );
dataGrid1.SetDataBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.Timer( );
logTimer.AutoReset = false;
logTimer.Interval = 250;
logTimer.SynchronizingObject = null;
logTimer.Elapsed += new
System.Timers.ElapsedEventHandler(logTimer_Elapsed );
logTimer.Enabled = true;
}

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

private void SpawnThread()
{
workerThread = new System.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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

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

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

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

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

BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new object[]{
(DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.SuspendLayout( );
dtSource.BeginLoadData( );

foreach( DataRow dr in drs )
dtSource.Rows.Add( dr );

dtSource.EndLoadData( );
dataGrid1.ResumeLayout( );

logTimer.Enabled = true;
}

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

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new
System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange (new
System.Windows.Forms.DataGridColumnStyle[] {

this.dataGridTextBoxColumn1});
this.dataGridTableStyle1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "Text";
this.dataGridTextBoxColumn1.MappingName = "Text";
this.dataGridTextBoxColumn1.ReadOnly = true;
this.dataGridTextBoxColumn1.Width = 75;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 453);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:F5**********************************@microsof t.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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81**********************************@microsof t.com...
> Hi people,
>
> The code that follows throws an ExecutionEngineException. 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
> ExecutionEngineException
> 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.Collections;
> using System.ComponentModel;
> 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.Timer logTimer = null;
> private readonly object logLock = new object( );
> private System.Threading.Thread workerThread = null;
> private int counter = 0;
>
> private System.Windows.Forms.DataGrid dataGrid1;
> private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
> private System.Windows.Forms.DataGridTextBoxColumn
> dataGridTextBoxColumn1;
> private System.ComponentModel.Container components = null;
>
> private delegate void SimpleHandler( );
> private delegate void AddRowsToTableHandler( DataRow[] drs );
>
> public Form1()
> {
> InitializeComponent();
>
> DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
> dtColumn.ReadOnly = true;
> dtSource.Columns.Add( dtColumn );
> dataGrid1.SetDataBinding( dtSource, null );
>
> logQueue = new ArrayList( );
>
> logTimer = new System.Timers.Timer( );
> logTimer.AutoReset = false;
> logTimer.Interval = 250;
> logTimer.SynchronizingObject = null;
> logTimer.Elapsed += new
> System.Timers.ElapsedEventHandler(logTimer_Elapsed );
> logTimer.Enabled = true;
> }
>
> private void OnLoad(object sender, System.EventArgs e)
> {
> SpawnThread( );
> }
>
> private void SpawnThread()
> {
> workerThread = new System.Threading.Thread( new
> System.Threading.ThreadStart( WorkingThread ) );
> workerThread.Start( );
> }
>
> private void WorkingThread( )
> {
> try
> {
> for( int i = 0; i != 8; ++i )
> Write( "Log line " + ++counter );
> }
> finally
> {
> this.BeginInvoke( new SimpleHandler( SpawnThread ) );
> }
> }
>
> public void Write( string text )
> {
> lock( logLock )
> logQueue.Add( text );
> }
>
> private void logTimer_Elapsed(object sender,
> System.Timers.ElapsedEventArgs e)
> {
> ArrayList writeOutQueue = null;
> lock( logLock )
> if( logQueue.Count != 0 )
> {
> writeOutQueue = logQueue;
> logQueue = new ArrayList( );
> }
>
> if( writeOutQueue == null )
> logTimer.Enabled = true;
> else
> {
> ArrayList dataRows = new ArrayList( );
>
> for( int i = 0; i != writeOutQueue.Count; ++i )
> {
> DataRow dr1 = dtSource.NewRow( );
> dr1[ "Text" ] = writeOutQueue[ i ];
> dataRows.Add( dr1 );
> }
>
> BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new
> object[]{
> (DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
> }
> }
>
> private void AddRowsToTable( DataRow[] drs )
> {
> dataGrid1.SuspendLayout( );
> dtSource.BeginLoadData( );
>
> foreach( DataRow dr in drs )
> dtSource.Rows.Add( dr );
>
> dtSource.EndLoadData( );
> dataGrid1.ResumeLayout( );
>
> logTimer.Enabled = true;
> }
>
> protected override void Dispose( bool disposing )
> {
> if( disposing )
> {
> if (components != null)
> {
> components.Dispose();
> }
> }
> base.Dispose( disposing );
> }
>
> #region Windows Form Designer generated code
> private void InitializeComponent()
> {
> this.dataGrid1 = new System.Windows.Forms.DataGrid();
> this.dataGridTableStyle1 = new
> System.Windows.Forms.DataGridTableStyle();
> this.dataGridTextBoxColumn1 = new
> System.Windows.Forms.DataGridTextBoxColumn();
>
> ((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
> this.SuspendLayout();
> //
> // dataGrid1
> //
> this.dataGrid1.DataMember = "";
> this.dataGrid1.HeaderForeColor =
> System.Drawing.SystemColors.ControlText;
> 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.AddRange(new
> System.Windows.Forms.DataGridTableStyle[] {
> this.dataGridTableStyle1});
> //
> // dataGridTableStyle1
> //
> this.dataGridTableStyle1.DataGrid = this.dataGrid1;
> this.dataGridTableStyle1.GridColumnStyles.AddRange (new
> System.Windows.Forms.DataGridColumnStyle[] {
>
> this.dataGridTextBoxColumn1});
> this.dataGridTableStyle1.HeaderForeColor =
> System.Drawing.SystemColors.ControlText;
> this.dataGridTableStyle1.MappingName = "";
> this.dataGridTableStyle1.ReadOnly = true;
> //
> // dataGridTextBoxColumn1
> //
> this.dataGridTextBoxColumn1.Format = "";
> this.dataGridTextBoxColumn1.FormatInfo = null;
> this.dataGridTextBoxColumn1.HeaderText = "Text";
> this.dataGridTextBoxColumn1.MappingName = "Text";
> this.dataGridTextBoxColumn1.ReadOnly = true;
> this.dataGridTextBoxColumn1.Width = 75;
> //
> // Form1
> //
> this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
> this.ClientSize = new System.Drawing.Size(608, 453);
> this.Controls.Add(this.dataGrid1);
> this.Name = "Form1";
> this.Text = "Form1";
> this.Load += new System.EventHandler(this.OnLoad);
>
> ((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
> this.ResumeLayout(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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:F5**********************************@microsof t.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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81**********************************@microsof t.com...
> Hi people,
>
> The code that follows throws an ExecutionEngineException. 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
> ExecutionEngineException
> 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.Collections;
> using System.ComponentModel;
> 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.Timer logTimer = null;
> private readonly object logLock = new object( );
> private System.Threading.Thread workerThread = null;
> private int counter = 0;
>
> private System.Windows.Forms.DataGrid dataGrid1;
> private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
> private System.Windows.Forms.DataGridTextBoxColumn
> dataGridTextBoxColumn1;
> private System.ComponentModel.Container components = null;
>
> private delegate void SimpleHandler( );
> private delegate void AddRowsToTableHandler( DataRow[] drs );
>
> public Form1()
> {
> InitializeComponent();
>
> DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
> dtColumn.ReadOnly = true;
> dtSource.Columns.Add( dtColumn );
> dataGrid1.SetDataBinding( dtSource, null );
>
> logQueue = new ArrayList( );
>
> logTimer = new System.Timers.Timer( );
> logTimer.AutoReset = false;
> logTimer.Interval = 250;
> logTimer.SynchronizingObject = null;
> logTimer.Elapsed += new
> System.Timers.ElapsedEventHandler(logTimer_Elapsed );
> logTimer.Enabled = true;
> }
>
> private void OnLoad(object sender, System.EventArgs e)
> {
> SpawnThread( );
> }
>
> private void SpawnThread()
> {
> workerThread = new System.Threading.Thread( new
> System.Threading.ThreadStart( WorkingThread ) );
> workerThread.Start( );
> }
>
> private void WorkingThread( )
> {
> try
> {
> for( int i = 0; i != 8; ++i )
> Write( "Log line " + ++counter );
> }
> finally
> {
> this.BeginInvoke( new SimpleHandler( SpawnThread ) );
> }
> }
>
> public void Write( string text )
> {
> lock( logLock )
> logQueue.Add( text );
> }
>
> private void logTimer_Elapsed(object sender,
> System.Timers.ElapsedEventArgs e)
> {
> ArrayList writeOutQueue = null;
> lock( logLock )
> if( logQueue.Count != 0 )
> {
> writeOutQueue = logQueue;
> logQueue = new ArrayList( );
> }
>
> if( writeOutQueue == null )
> logTimer.Enabled = true;
> else
> {
> ArrayList dataRows = new ArrayList( );
>
> for( int i = 0; i != writeOutQueue.Count; ++i )
> {
> DataRow dr1 = dtSource.NewRow( );
> dr1[ "Text" ] = writeOutQueue[ i ];
> dataRows.Add( dr1 );
> }
>
> BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new
> object[]{
> (DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
> }
> }
>
> private void AddRowsToTable( DataRow[] drs )
> {
> dataGrid1.SuspendLayout( );
> dtSource.BeginLoadData( );
>
> foreach( DataRow dr in drs )
> dtSource.Rows.Add( dr );
>
> dtSource.EndLoadData( );
> dataGrid1.ResumeLayout( );
>
> logTimer.Enabled = true;
> }
>
> protected override void Dispose( bool disposing )
> {
> if( disposing )
> {
> if (components != null)
> {
> components.Dispose();
> }
> }
> base.Dispose( disposing );
> }
>
> #region Windows Form Designer generated code
> private void InitializeComponent()
> {
> this.dataGrid1 = new System.Windows.Forms.DataGrid();
> this.dataGridTableStyle1 = new
> System.Windows.Forms.DataGridTableStyle();
> this.dataGridTextBoxColumn1 = new
> System.Windows.Forms.DataGridTextBoxColumn();
>
> ((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
> this.SuspendLayout();
> //
> // dataGrid1
> //
> this.dataGrid1.DataMember = "";
> this.dataGrid1.HeaderForeColor =
> System.Drawing.SystemColors.ControlText;
> 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.AddRange(new
> System.Windows.Forms.DataGridTableStyle[] {
> this.dataGridTableStyle1});
> //
> // dataGridTableStyle1
> //
> this.dataGridTableStyle1.DataGrid = this.dataGrid1;
> this.dataGridTableStyle1.GridColumnStyles.AddRange (new
> System.Windows.Forms.DataGridColumnStyle[] {
>
> this.dataGridTextBoxColumn1});
> this.dataGridTableStyle1.HeaderForeColor =
> System.Drawing.SystemColors.ControlText;
> this.dataGridTableStyle1.MappingName = "";
> this.dataGridTableStyle1.ReadOnly = true;
> //
> // dataGridTextBoxColumn1
> //
> this.dataGridTextBoxColumn1.Format = "";
> this.dataGridTextBoxColumn1.FormatInfo = null;
> this.dataGridTextBoxColumn1.HeaderText = "Text";
> this.dataGridTextBoxColumn1.MappingName = "Text";
> this.dataGridTextBoxColumn1.ReadOnly = true;
> this.dataGridTextBoxColumn1.Width = 75;
> //
> // Form1
> //
> this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
> this.ClientSize = new System.Drawing.Size(608, 453);
> this.Controls.Add(this.dataGrid1);
> this.Name = "Form1";
> this.Text = "Form1";
> this.Load += new System.EventHandler(this.OnLoad);
>
> ((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
> this.ResumeLayout(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.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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@_spamkiller_bobpowell.net> wrote in message
news:u4**************@TK2MSFTNGP11.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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81**********************************@microsof t.com...
Hi people,

The code that follows throws an ExecutionEngineException. 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
ExecutionEngineException 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.Collections;
using System.ComponentModel;
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.Timer logTimer = null;
private readonly object logLock = new object( );
private System.Threading.Thread workerThread = null;
private int counter = 0;

private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn
dataGridTextBoxColumn1;
private System.ComponentModel.Container components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableHandler( DataRow[] drs );

public Form1()
{
InitializeComponent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOnly = true;
dtSource.Columns.Add( dtColumn );
dataGrid1.SetDataBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.Timer( );
logTimer.AutoReset = false;
logTimer.Interval = 250;
logTimer.SynchronizingObject = null;
logTimer.Elapsed += new
System.Timers.ElapsedEventHandler(logTimer_Elapsed );
logTimer.Enabled = true;
}

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

private void SpawnThread()
{
workerThread = new System.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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

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

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

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

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

BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new
object[]{
(DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.SuspendLayout( );
dtSource.BeginLoadData( );

foreach( DataRow dr in drs )
dtSource.Rows.Add( dr );

dtSource.EndLoadData( );
dataGrid1.ResumeLayout( );

logTimer.Enabled = true;
}

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

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new
System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange (new
System.Windows.Forms.DataGridColumnStyle[] {

this.dataGridTextBoxColumn1});
this.dataGridTableStyle1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "Text";
this.dataGridTextBoxColumn1.MappingName = "Text";
this.dataGridTextBoxColumn1.ReadOnly = true;
this.dataGridTextBoxColumn1.Width = 75;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 453);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(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 ExecutionEngineException
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.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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@_spamkiller_bobpowell.net> wrote in message
news:u4**************@TK2MSFTNGP11.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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81**********************************@microsof t.com...
Hi people,

The code that follows throws an ExecutionEngineException. 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
ExecutionEngineException 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.Collections;
using System.ComponentModel;
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.Timer logTimer = null;
private readonly object logLock = new object( );
private System.Threading.Thread workerThread = null;
private int counter = 0;

private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn
dataGridTextBoxColumn1;
private System.ComponentModel.Container components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableHandler( DataRow[] drs );

public Form1()
{
InitializeComponent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOnly = true;
dtSource.Columns.Add( dtColumn );
dataGrid1.SetDataBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.Timer( );
logTimer.AutoReset = false;
logTimer.Interval = 250;
logTimer.SynchronizingObject = null;
logTimer.Elapsed += new
System.Timers.ElapsedEventHandler(logTimer_Elapsed );
logTimer.Enabled = true;
}

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

private void SpawnThread()
{
workerThread = new System.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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

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

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

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

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

BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new
object[]{
(DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.SuspendLayout( );
dtSource.BeginLoadData( );

foreach( DataRow dr in drs )
dtSource.Rows.Add( dr );

dtSource.EndLoadData( );
dataGrid1.ResumeLayout( );

logTimer.Enabled = true;
}

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

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new
System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange (new
System.Windows.Forms.DataGridColumnStyle[] {

this.dataGridTextBoxColumn1});
this.dataGridTableStyle1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "Text";
this.dataGridTextBoxColumn1.MappingName = "Text";
this.dataGridTextBoxColumn1.ReadOnly = true;
this.dataGridTextBoxColumn1.Width = 75;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 453);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.OnLoad);
((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion

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

Kind regards,
--
Tom Tempelaere.



Nov 17 '05 #8

"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:0A**********************************@microsof t.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 ExecutionEngineException
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**************@tk2msftngp13.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.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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@_spamkiller_bobpowell.net> wrote in message
news:u4**************@TK2MSFTNGP11.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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message
news:81**********************************@microsof t.com...
Hi people,

The code that follows throws an ExecutionEngineException. 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
ExecutionEngineException 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.Collections;
using System.ComponentModel;
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.Timer logTimer = null;
private readonly object logLock = new object( );
private System.Threading.Thread workerThread = null;
private int counter = 0;

private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn
dataGridTextBoxColumn1;
private System.ComponentModel.Container components = null;

private delegate void SimpleHandler( );
private delegate void AddRowsToTableHandler( DataRow[] drs );

public Form1()
{
InitializeComponent();

DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
dtColumn.ReadOnly = true;
dtSource.Columns.Add( dtColumn );
dataGrid1.SetDataBinding( dtSource, null );

logQueue = new ArrayList( );

logTimer = new System.Timers.Timer( );
logTimer.AutoReset = false;
logTimer.Interval = 250;
logTimer.SynchronizingObject = null;
logTimer.Elapsed += new
System.Timers.ElapsedEventHandler(logTimer_Elapsed );
logTimer.Enabled = true;
}

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

private void SpawnThread()
{
workerThread = new System.Threading.Thread( new
System.Threading.ThreadStart( WorkingThread ) );
workerThread.Start( );
}

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

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

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

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

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

BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new
object[]{
(DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
}
}

private void AddRowsToTable( DataRow[] drs )
{
dataGrid1.SuspendLayout( );
dtSource.BeginLoadData( );

foreach( DataRow dr in drs )
dtSource.Rows.Add( dr );

dtSource.EndLoadData( );
dataGrid1.ResumeLayout( );

logTimer.Enabled = true;
}

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

#region Windows Form Designer generated code
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new
System.Windows.Forms.DataGridTableStyle();
this.dataGridTextBoxColumn1 = new
System.Windows.Forms.DataGridTextBoxColumn();

((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
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.AddRange(new
System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.dataGrid1;
this.dataGridTableStyle1.GridColumnStyles.AddRange (new
System.Windows.Forms.DataGridColumnStyle[] {

this.dataGridTextBoxColumn1});
this.dataGridTableStyle1.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
this.dataGridTableStyle1.ReadOnly = true;
//
// dataGridTextBoxColumn1
//
this.dataGridTextBoxColumn1.Format = "";
this.dataGridTextBoxColumn1.FormatInfo = null;
this.dataGridTextBoxColumn1.HeaderText = "Text";
this.dataGridTextBoxColumn1.MappingName = "Text";
this.dataGridTextBoxColumn1.ReadOnly = true;
this.dataGridTextBoxColumn1.Width = 75;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 453);
this.Controls.Add(this.dataGrid1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.OnLoad);

((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion

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

Kind regards,
--
Tom Tempelaere.



Nov 17 '05 #10

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:Om*************@TK2MSFTNGP12.phx.gbl...
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]


Do you mean you could smoothly scroll the grid? What I noticed is that the
program creates +32000 threads per second using v2.0 and +36000 on v1.1,
when run on a real fast system. This extreme high thread spawning rate
renders the UI non responsive on a fast sytem (I've seen it's handle count
going higher than 27000), on slow system the UI is more or less responsive
(well sort of). Anyway this program is a CPU hog.

Willy.
Nov 17 '05 #11
Willy, Bob,

I didn't know it could create and destroy that much threads per second. It's
worth noting :).

Thanks for the input.
Tom.

"Willy Denoyette [MVP]" <wi*************@telenet.be> schreef in bericht
news:eQ*************@TK2MSFTNGP11.phx.gbl...

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:Om*************@TK2MSFTNGP12.phx.gbl...
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]


Do you mean you could smoothly scroll the grid? What I noticed is that the
program creates +32000 threads per second using v2.0 and +36000 on v1.1,
when run on a real fast system. This extreme high thread spawning rate
renders the UI non responsive on a fast sytem (I've seen it's handle count
going higher than 27000), on slow system the UI is more or less responsive
(well sort of). Anyway this program is a CPU hog.

Willy.

Nov 17 '05 #12
Note that the figures I gave in a previous post were wrong, these are the
number of messages written to the grid per second, the number of threads per
second are ~4000 and ~4500.

Actually, you don't destroy the threads, the thread procedure is just a
simple loop calling 8 times Write() followed by a call to BeginInvoke, when
this call returns the thread procedure exits and the thread terminates, now
the BeginInvoke call results in the creation of a new thread that runs the
same procedure again. That means that your thread creations are serialized
by the message loop, so you'll never have more than one such thread running.
Anyway, you are burning a lot of cycles just to write 8 messages to a grid,
the overhead of the thread creation is enormous, and again it deadlocks on a
SMP box, but I can't see why honestly.

Willy.

"TT (Tom Tempelaere)" </\/_0_$P@/\/\titi____AThotmailD.Tcom/\/\@P$_0_/\/>
wrote in message news:JY******************@phobos.telenet-ops.be...
Willy, Bob,

I didn't know it could create and destroy that much threads per second.
It's worth noting :).

Thanks for the input.
Tom.

"Willy Denoyette [MVP]" <wi*************@telenet.be> schreef in bericht
news:eQ*************@TK2MSFTNGP11.phx.gbl...

"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:Om*************@TK2MSFTNGP12.phx.gbl...
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]


Do you mean you could smoothly scroll the grid? What I noticed is that
the program creates +32000 threads per second using v2.0 and +36000 on
v1.1, when run on a real fast system. This extreme high thread spawning
rate renders the UI non responsive on a fast sytem (I've seen it's handle
count going higher than 27000), on slow system the UI is more or less
responsive (well sort of). Anyway this program is a CPU hog.

Willy.


Nov 17 '05 #13
Hi again,

Bad news. The installation of SP1 seems to introduce other problems leading
to ExecutionEngineException's again! The problems occur less than before
(only once/twice a day for continuously running process) but is a MAJOR
obstruction to our project. I cannot express how I feel about this (at least
_very_ negative) because both .NET 1.1 and .NET 1.1/SP1 give problems with
our code.

I don't really know what to do with the problem, except cutting the
functionality from the project.

Kind regards,
--
Tom Tempelaere.
"TT (Tom Tempelaere)" wrote:
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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:F5**********************************@microsof t.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____AThotmailD.Tcom|/\|@P$0_|\|_>
> wrote in message
> news:81**********************************@microsof t.com...
> > Hi people,
> >
> > The code that follows throws an ExecutionEngineException. 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
> > ExecutionEngineException
> > 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.Collections;
> > using System.ComponentModel;
> > 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.Timer logTimer = null;
> > private readonly object logLock = new object( );
> > private System.Threading.Thread workerThread = null;
> > private int counter = 0;
> >
> > private System.Windows.Forms.DataGrid dataGrid1;
> > private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
> > private System.Windows.Forms.DataGridTextBoxColumn
> > dataGridTextBoxColumn1;
> > private System.ComponentModel.Container components = null;
> >
> > private delegate void SimpleHandler( );
> > private delegate void AddRowsToTableHandler( DataRow[] drs );
> >
> > public Form1()
> > {
> > InitializeComponent();
> >
> > DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
> > dtColumn.ReadOnly = true;
> > dtSource.Columns.Add( dtColumn );
> > dataGrid1.SetDataBinding( dtSource, null );
> >
> > logQueue = new ArrayList( );
> >
> > logTimer = new System.Timers.Timer( );
> > logTimer.AutoReset = false;
> > logTimer.Interval = 250;
> > logTimer.SynchronizingObject = null;
> > logTimer.Elapsed += new
> > System.Timers.ElapsedEventHandler(logTimer_Elapsed );
> > logTimer.Enabled = true;
> > }
> >
> > private void OnLoad(object sender, System.EventArgs e)
> > {
> > SpawnThread( );
> > }
> >
> > private void SpawnThread()
> > {
> > workerThread = new System.Threading.Thread( new
> > System.Threading.ThreadStart( WorkingThread ) );
> > workerThread.Start( );
> > }
> >
> > private void WorkingThread( )
> > {
> > try
> > {
> > for( int i = 0; i != 8; ++i )
> > Write( "Log line " + ++counter );
> > }
> > finally
> > {
> > this.BeginInvoke( new SimpleHandler( SpawnThread ) );
> > }
> > }
> >
> > public void Write( string text )
> > {
> > lock( logLock )
> > logQueue.Add( text );
> > }
> >
> > private void logTimer_Elapsed(object sender,
> > System.Timers.ElapsedEventArgs e)
> > {
> > ArrayList writeOutQueue = null;
> > lock( logLock )
> > if( logQueue.Count != 0 )
> > {
> > writeOutQueue = logQueue;
> > logQueue = new ArrayList( );
> > }
> >
> > if( writeOutQueue == null )
> > logTimer.Enabled = true;
> > else
> > {
> > ArrayList dataRows = new ArrayList( );
> >
> > for( int i = 0; i != writeOutQueue.Count; ++i )
> > {
> > DataRow dr1 = dtSource.NewRow( );
> > dr1[ "Text" ] = writeOutQueue[ i ];
> > dataRows.Add( dr1 );
> > }
> >
> > BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new
> > object[]{
> > (DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
> > }
> > }
> >
> > private void AddRowsToTable( DataRow[] drs )
> > {
> > dataGrid1.SuspendLayout( );
> > dtSource.BeginLoadData( );
> >
> > foreach( DataRow dr in drs )
> > dtSource.Rows.Add( dr );
> >
> > dtSource.EndLoadData( );
> > dataGrid1.ResumeLayout( );
> >
> > logTimer.Enabled = true;
> > }
> >
> > protected override void Dispose( bool disposing )
> > {
> > if( disposing )
> > {
> > if (components != null)
> > {
> > components.Dispose();
> > }
> > }
> > base.Dispose( disposing );
> > }
> >
> > #region Windows Form Designer generated code
> > private void InitializeComponent()
> > {
> > this.dataGrid1 = new System.Windows.Forms.DataGrid();
> > this.dataGridTableStyle1 = new
> > System.Windows.Forms.DataGridTableStyle();
> > this.dataGridTextBoxColumn1 = new
> > System.Windows.Forms.DataGridTextBoxColumn();
> >
> > ((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
> > this.SuspendLayout();
> > //
> > // dataGrid1
> > //
> > this.dataGrid1.DataMember = "";
> > this.dataGrid1.HeaderForeColor =
> > System.Drawing.SystemColors.ControlText;
> > 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.AddRange(new
> > System.Windows.Forms.DataGridTableStyle[] {
> > this.dataGridTableStyle1});
> > //
> > // dataGridTableStyle1
> > //
> > this.dataGridTableStyle1.DataGrid = this.dataGrid1;
> > this.dataGridTableStyle1.GridColumnStyles.AddRange (new
> > System.Windows.Forms.DataGridColumnStyle[] {
> >
> > this.dataGridTextBoxColumn1});
> > this.dataGridTableStyle1.HeaderForeColor =
> > System.Drawing.SystemColors.ControlText;
> > this.dataGridTableStyle1.MappingName = "";
> > this.dataGridTableStyle1.ReadOnly = true;
> > //
> > // dataGridTextBoxColumn1
> > //
> > this.dataGridTextBoxColumn1.Format = "";
> > this.dataGridTextBoxColumn1.FormatInfo = null;
> > this.dataGridTextBoxColumn1.HeaderText = "Text";
> > this.dataGridTextBoxColumn1.MappingName = "Text";
> > this.dataGridTextBoxColumn1.ReadOnly = true;
> > this.dataGridTextBoxColumn1.Width = 75;
> > //
> > // Form1
> > //
> > this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
> > this.ClientSize = new System.Drawing.Size(608, 453);
> > this.Controls.Add(this.dataGrid1);
> > this.Name = "Form1";
> > this.Text = "Form1";
> > this.Load += new System.EventHandler(this.OnLoad);
> >
> > ((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).EndInit();
> > this.ResumeLayout(false);
> > }

Nov 17 '05 #14
Hi,

Once more I'm falling for the obvious trap, being, I'm posting problems I
have _way _ too fast. Misinformation led me to believe that SP1 was already
installed on the target machine, which was not the case (people who
installed, told me they had:'( ).

I apologize to this group, and to MS, for being so stupid and for not
verifying before posting. I shall try to be more clever in the future.

Kind regards,
--
Tom Tempelaere.
"TT (Tom Tempelaere)" wrote:
Hi again,

Bad news. The installation of SP1 seems to introduce other problems leading
to ExecutionEngineException's again! The problems occur less than before
(only once/twice a day for continuously running process) but is a MAJOR
obstruction to our project. I cannot express how I feel about this (at least
_very_ negative) because both .NET 1.1 and .NET 1.1/SP1 give problems with
our code.

I don't really know what to do with the problem, except cutting the
functionality from the project.

Kind regards,
--
Tom Tempelaere.
"TT (Tom Tempelaere)" wrote:
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____AThotmailD.Tcom|/\|@P$0_|\|_>
wrote in message news:F5**********************************@microsof t.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____AThotmailD.Tcom|/\|@P$0_|\|_>
>> wrote in message
>> news:81**********************************@microsof t.com...
>> > Hi people,
>> >
>> > The code that follows throws an ExecutionEngineException. 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
>> > ExecutionEngineException
>> > 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.Collections;
>> > using System.ComponentModel;
>> > 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.Timer logTimer = null;
>> > private readonly object logLock = new object( );
>> > private System.Threading.Thread workerThread = null;
>> > private int counter = 0;
>> >
>> > private System.Windows.Forms.DataGrid dataGrid1;
>> > private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
>> > private System.Windows.Forms.DataGridTextBoxColumn
>> > dataGridTextBoxColumn1;
>> > private System.ComponentModel.Container components = null;
>> >
>> > private delegate void SimpleHandler( );
>> > private delegate void AddRowsToTableHandler( DataRow[] drs );
>> >
>> > public Form1()
>> > {
>> > InitializeComponent();
>> >
>> > DataColumn dtColumn = new DataColumn( "Text", typeof(string) );
>> > dtColumn.ReadOnly = true;
>> > dtSource.Columns.Add( dtColumn );
>> > dataGrid1.SetDataBinding( dtSource, null );
>> >
>> > logQueue = new ArrayList( );
>> >
>> > logTimer = new System.Timers.Timer( );
>> > logTimer.AutoReset = false;
>> > logTimer.Interval = 250;
>> > logTimer.SynchronizingObject = null;
>> > logTimer.Elapsed += new
>> > System.Timers.ElapsedEventHandler(logTimer_Elapsed );
>> > logTimer.Enabled = true;
>> > }
>> >
>> > private void OnLoad(object sender, System.EventArgs e)
>> > {
>> > SpawnThread( );
>> > }
>> >
>> > private void SpawnThread()
>> > {
>> > workerThread = new System.Threading.Thread( new
>> > System.Threading.ThreadStart( WorkingThread ) );
>> > workerThread.Start( );
>> > }
>> >
>> > private void WorkingThread( )
>> > {
>> > try
>> > {
>> > for( int i = 0; i != 8; ++i )
>> > Write( "Log line " + ++counter );
>> > }
>> > finally
>> > {
>> > this.BeginInvoke( new SimpleHandler( SpawnThread ) );
>> > }
>> > }
>> >
>> > public void Write( string text )
>> > {
>> > lock( logLock )
>> > logQueue.Add( text );
>> > }
>> >
>> > private void logTimer_Elapsed(object sender,
>> > System.Timers.ElapsedEventArgs e)
>> > {
>> > ArrayList writeOutQueue = null;
>> > lock( logLock )
>> > if( logQueue.Count != 0 )
>> > {
>> > writeOutQueue = logQueue;
>> > logQueue = new ArrayList( );
>> > }
>> >
>> > if( writeOutQueue == null )
>> > logTimer.Enabled = true;
>> > else
>> > {
>> > ArrayList dataRows = new ArrayList( );
>> >
>> > for( int i = 0; i != writeOutQueue.Count; ++i )
>> > {
>> > DataRow dr1 = dtSource.NewRow( );
>> > dr1[ "Text" ] = writeOutQueue[ i ];
>> > dataRows.Add( dr1 );
>> > }
>> >
>> > BeginInvoke( new AddRowsToTableHandler( AddRowsToTable ), new
>> > object[]{
>> > (DataRow[]) dataRows.ToArray( typeof(DataRow) ) } );
>> > }
>> > }
>> >
>> > private void AddRowsToTable( DataRow[] drs )
>> > {
>> > dataGrid1.SuspendLayout( );
>> > dtSource.BeginLoadData( );
>> >
>> > foreach( DataRow dr in drs )
>> > dtSource.Rows.Add( dr );
>> >
>> > dtSource.EndLoadData( );
>> > dataGrid1.ResumeLayout( );
>> >
>> > logTimer.Enabled = true;
>> > }
>> >
>> > protected override void Dispose( bool disposing )
>> > {
>> > if( disposing )
>> > {
>> > if (components != null)
>> > {
>> > components.Dispose();
>> > }
>> > }
>> > base.Dispose( disposing );
>> > }
>> >
>> > #region Windows Form Designer generated code
>> > private void InitializeComponent()
>> > {
>> > this.dataGrid1 = new System.Windows.Forms.DataGrid();
>> > this.dataGridTableStyle1 = new
>> > System.Windows.Forms.DataGridTableStyle();
>> > this.dataGridTextBoxColumn1 = new
>> > System.Windows.Forms.DataGridTextBoxColumn();
>> >
>> > ((System.ComponentModel.ISupportInitialize)(this.d ataGrid1)).BeginInit();
>> > this.SuspendLayout();
>> > //
>> > // dataGrid1
>> > //
>> > this.dataGrid1.DataMember = "";
>> > this.dataGrid1.HeaderForeColor =
>> > System.Drawing.SystemColors.ControlText;
>> > 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.AddRange(new
>> > System.Windows.Forms.DataGridTableStyle[] {
>> > this.dataGridTableStyle1});
>> > //
>> > // dataGridTableStyle1
>> > //
>> > this.dataGridTableStyle1.DataGrid = this.dataGrid1;
>> > this.dataGridTableStyle1.GridColumnStyles.AddRange (new
>> > System.Windows.Forms.DataGridColumnStyle[] {
>> >
>> > this.dataGridTextBoxColumn1});
>> > this.dataGridTableStyle1.HeaderForeColor =
>> > System.Drawing.SystemColors.ControlText;
>> > this.dataGridTableStyle1.MappingName = "";
>> > this.dataGridTableStyle1.ReadOnly = true;
>> > //
>> > // dataGridTextBoxColumn1
>> > //

Nov 17 '05 #15

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

Similar topics

0
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...
0
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
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...
1
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...
0
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...
1
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 ->...
13
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()...
0
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...
3
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...
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.