Click here to Skip to main content
15,902,276 members
Home / Discussions / C#
   

C#

 
GeneralRe: ToolBoxBitmap Pin
Fabio Zanetta15-Jan-07 5:19
Fabio Zanetta15-Jan-07 5:19 
Questionpaint on ListView isn't working Pin
teejayem15-Jan-07 2:41
teejayem15-Jan-07 2:41 
AnswerRe: web service Pin
Guffa15-Jan-07 2:37
Guffa15-Jan-07 2:37 
QuestionI can not open new form.It gives errors in vs 2005 Pin
Member 372644115-Jan-07 1:53
Member 372644115-Jan-07 1:53 
GeneralRe: I can not open new form.It gives errors in vs 2005 Pin
Seishin#15-Jan-07 2:04
Seishin#15-Jan-07 2:04 
Questionmultithreading problem Pin
justintimberlake15-Jan-07 1:51
justintimberlake15-Jan-07 1:51 
AnswerRe: multithreading problem Pin
Russell Jones15-Jan-07 2:47
Russell Jones15-Jan-07 2:47 
AnswerRe: multithreading problem Pin
coolestCoder15-Jan-07 3:34
coolestCoder15-Jan-07 3:34 
It is very simple. First of all, use try catch finally block to handle exceptions. This is important if you want to use the solution suggested by me.

In the CallOnCreated function, stop the timer at first in the try block. Then your current code will be there. Then in finally block start the timer again. this is as simple as it sounds.

Now your code will look like this --

public void CallOnCreated()
{
try
{
<code>Timer1.Stop();</code>
DirectoryInfo dirInfo = new DirectoryInfo(@"C:/datahandler1");
fInfo = dirInfo.GetFiles("*.xml");

threads= new Thread[fInfo.Length];
sFileNames=new string[fInfo.Length];

if(fInfo.Length!=0)
{
for(int i=0;i
{
if(pics.BinarySearch(fInfo[i].FullName)<0)
{
pics.Add(fInfo[i].FullName);
}
}
foreach(string file in pics)
{

Console.WriteLine(file.ToString());

myFile myf= new myFile(file);
if(myf.isUsed())
{
continue;
}
try
{

clsCall objcall= new clsCall(file);
threads[i]= new Thread(new ThreadStart(objcall.getCallClass));
threads[i].Name="thread is " + sFileNames[i];
// clsError objcl= new clsError(sFileNames[i] +" " +threads[i].Name);
// objcl.AddToError();
threads[i].Start();
}
catch
{
}
finally
{
<code>Timer1.Start();</code>
}

}



"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder

coolestCoder

Questionsize of text array - limitations Pin
electriac15-Jan-07 1:49
electriac15-Jan-07 1:49 
AnswerRe: size of text array - limitations Pin
Pete O'Hanlon15-Jan-07 2:01
mvePete O'Hanlon15-Jan-07 2:01 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 2:06
electriac15-Jan-07 2:06 
GeneralRe: size of text array - limitations Pin
Pete O'Hanlon15-Jan-07 2:18
mvePete O'Hanlon15-Jan-07 2:18 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 2:47
electriac15-Jan-07 2:47 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 2:58
electriac15-Jan-07 2:58 
GeneralRe: size of text array - limitations Pin
Pete O'Hanlon15-Jan-07 3:07
mvePete O'Hanlon15-Jan-07 3:07 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:14
electriac15-Jan-07 3:14 
GeneralRe: size of text array - limitations Pin
Dan Neely15-Jan-07 3:23
Dan Neely15-Jan-07 3:23 
GeneralRe: size of text array - limitations Pin
J4amieC15-Jan-07 3:13
J4amieC15-Jan-07 3:13 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:19
electriac15-Jan-07 3:19 
GeneralRe: size of text array - limitations Pin
J4amieC15-Jan-07 3:34
J4amieC15-Jan-07 3:34 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:37
electriac15-Jan-07 3:37 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:34
electriac15-Jan-07 3:34 
GeneralRe: size of text array - limitations Pin
Pete O'Hanlon15-Jan-07 3:21
mvePete O'Hanlon15-Jan-07 3:21 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 3:44
electriac15-Jan-07 3:44 
GeneralRe: size of text array - limitations Pin
electriac15-Jan-07 11:04
electriac15-Jan-07 11:04 

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.