Click here to Skip to main content
15,893,594 members
Home / Discussions / C#
   

C#

 
QuestionFile.Exists question? Pin
jzb6-Sep-04 1:03
jzb6-Sep-04 1:03 
AnswerRe: File.Exists question? Pin
Tom Larsen6-Sep-04 4:13
Tom Larsen6-Sep-04 4:13 
AnswerRe: File.Exists question? Pin
Heath Stewart6-Sep-04 9:43
protectorHeath Stewart6-Sep-04 9:43 
AnswerRe: File.Exists question? Pin
Bill Dean6-Sep-04 13:36
Bill Dean6-Sep-04 13:36 
GeneralSmart Device Application with SQL Server Ce Pin
mathon6-Sep-04 0:28
mathon6-Sep-04 0:28 
GeneralDataGrid hangs when using threads Pin
tobiaseriksson6-Sep-04 0:00
tobiaseriksson6-Sep-04 0:00 
GeneralRe: DataGrid hangs when using threads Pin
Roger Alsing6-Sep-04 3:47
Roger Alsing6-Sep-04 3:47 
GeneralRe: DataGrid hangs when using threads Pin
tobiaseriksson6-Sep-04 4:55
tobiaseriksson6-Sep-04 4:55 
Hi,
Now I've implemented a solution which seems to work fine.

This is what I needed to do:
1) Create a 'delegate' which had the same signature as my addToLog(...)-method.

public delegate void myDelegate( string id, string e, TimeSpan ts );

2) Modify the responseThread()-method so that it creates the delegate
myDelegate md = new myDelegate( addToLog );

3) Modify the responseThread()-method so that it calls (or more accurately invokes) the delegate with the appropriate arguments:
so the line that before said:
this.addToLog( ""+(index++), "thread", rTimeDiff );
Now says:
this.Invoke( md, new Object[] { ""+(index++), "thread", rTimeDiff } );


private void responseThread() <br />
		{			<br />
			string sThreadName = "ResponsePollingThread";<br />
			Thread.CurrentThread.Name = sThreadName;<br />
			string sTmp = null;<br />
			string sSeparator = "\n*************************************\n";<br />
			bool found = false;<br />
			string searchstring = null;<br />
			myDelegate md = new myDelegate( addToLog );<br />
			try <br />
			{<br />
				while( true ) <br />
				{<br />
					DateTime rTmp = DateTime.Now;<br />
					TimeSpan rTimeDiff = rTmp - rStartTimeStamp;<br />
					// this.addToLog( ""+(index++), "thread", rTimeDiff );<br />
					this.Invoke( md, new Object[] { ""+(index++), "thread", rTimeDiff } );<br />
					Thread.Sleep( 1000 );<br />
				}<br />
			}<br />
			catch( Exception e ) <br />
			{<br />
				// Console.WriteLine( "Exception in "+sThreadName+", exception; "+e );<br />
				Console.WriteLine( "Updater-thread ended." );<br />
			}<br />
		}

GeneralChild Window with Focus *at same time as parent* Pin
Geekkit5-Sep-04 23:35
Geekkit5-Sep-04 23:35 
GeneralI have a problem,Creating xslt instructions Pin
teo_x5-Sep-04 22:37
teo_x5-Sep-04 22:37 
GeneralGet server time from remote server Pin
cbmdk5-Sep-04 22:19
cbmdk5-Sep-04 22:19 
GeneralProblems with huge files Pin
clatten5-Sep-04 22:15
clatten5-Sep-04 22:15 
GeneralRe: Problems with huge files Pin
Sebastian Schneider6-Sep-04 3:11
Sebastian Schneider6-Sep-04 3:11 
GeneralRe: Problems with huge files Pin
clatten6-Sep-04 10:07
clatten6-Sep-04 10:07 
GeneralEnabledChanged event of inputPanel of .NET CF error Pin
ting6685-Sep-04 21:25
ting6685-Sep-04 21:25 
GeneralDirectly deriving from MulticastDelegate Pin
Paul Selormey5-Sep-04 21:08
Paul Selormey5-Sep-04 21:08 
GeneralRe: Directly deriving from MulticastDelegate Pin
sreejith ss nair5-Sep-04 22:57
sreejith ss nair5-Sep-04 22:57 
GeneralRe: Directly deriving from MulticastDelegate Pin
Paul Selormey5-Sep-04 23:06
Paul Selormey5-Sep-04 23:06 
Generala question of Directx9 Pin
sssa20005-Sep-04 20:15
sssa20005-Sep-04 20:15 
GeneralRe: a question of Directx9 Pin
EssOEss6-Sep-04 5:01
EssOEss6-Sep-04 5:01 
GeneralC# equivalent of the /fx C++ compiler option Pin
Paul Selormey5-Sep-04 20:10
Paul Selormey5-Sep-04 20:10 
GeneralRe: C# equivalent of the /fx C++ compiler option Pin
leppie5-Sep-04 23:08
leppie5-Sep-04 23:08 
GeneralRe: C# equivalent of the /fx C++ compiler option Pin
Paul Selormey6-Sep-04 0:34
Paul Selormey6-Sep-04 0:34 
GeneralRe: C# equivalent of the /fx C++ compiler option Pin
EssOEss6-Sep-04 5:03
EssOEss6-Sep-04 5:03 
GeneralRe: C# equivalent of the /fx C++ compiler option Pin
Paul Selormey6-Sep-04 12:25
Paul Selormey6-Sep-04 12:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.