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
14 2047
"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:Om******** *****@TK2MSFTNG P12.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.
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******** *****@TK2MSFTNG P11.phx.gbl... "Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message news:Om******** *****@TK2MSFTNG P12.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.
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____AThotm ailD.Tcom/\/\@P$_0_/\/>
wrote in message news:JY******** **********@phob os.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******** *****@TK2MSFTNG P11.phx.gbl... "Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message news:Om******** *****@TK2MSFTNG P12.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.
Hi again,
Bad news. The installation of SP1 seems to introduce other problems leading
to ExecutionEngine Exception'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____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); > > }
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 ExecutionEngine Exception'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____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 thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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(
|
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...
|
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...
|
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,
| |
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
|
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. ...
|
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
|
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...
|
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
|
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...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |