Click here to Skip to main content
15,887,302 members
Home / Discussions / C#
   

C#

 
QuestionHow store formatted text [modified] Pin
sepel30-Sep-08 9:05
sepel30-Sep-08 9:05 
AnswerRe: How store formatted text Pin
User 665830-Sep-08 10:07
User 665830-Sep-08 10:07 
QuestionRecording Voice from microphone Pin
Ha ha ha ha ha ha ha ha30-Sep-08 8:12
Ha ha ha ha ha ha ha ha30-Sep-08 8:12 
AnswerRe: Recording Voice from microphone Pin
Mbah Dhaim30-Sep-08 10:29
Mbah Dhaim30-Sep-08 10:29 
GeneralRe: Recording Voice from microphone Pin
Ha ha ha ha ha ha ha ha30-Sep-08 22:25
Ha ha ha ha ha ha ha ha30-Sep-08 22:25 
GeneralRe: Recording Voice from microphone Pin
fiko851-Oct-08 7:05
fiko851-Oct-08 7:05 
GeneralRe: Recording Voice from microphone Pin
Ha ha ha ha ha ha ha ha2-Oct-08 22:15
Ha ha ha ha ha ha ha ha2-Oct-08 22:15 
QuestionMultiple Threads Pin
Ha ha ha ha ha ha ha ha30-Sep-08 8:10
Ha ha ha ha ha ha ha ha30-Sep-08 8:10 
Hi everyone
I'm developing an application which needs to use multiple threads. As the number of threads needed becomes known during runtime,
I have used an array of threads called "thrRec", all threads use the same method called "readBufferThr(int sh,int uu)"and pass different arguments to it.
My problem is that for example if I choose to run 5 threads, the first thread doesn't call the method properly. Next threads, have no problem, but the first one
wants to run the method in the end and passes wrong arguments to it. Here is my code:


Thread []thrRec=new Thread[chLBDev.CheckedItems.Count];
ThreadStart[] thrStrartRec = new ThreadStart[chLBDev.CheckedItems.Count];
int u=0;

foreach (int i in chLBDev.CheckedIndices)
{
thrStrartRec[u] = new ThreadStart(delegate { readBufferThr(i,u); });
thrRec[u] = new Thread(thrStrartRec[u]);
thrRec[u].Start();
u++;
}

readBufferThr(int sh,int uu)
{
//do something
}

Where's the problem?
Please help.
AnswerRe: Multiple Threads Pin
Ashfield30-Sep-08 21:20
Ashfield30-Sep-08 21:20 
GeneralRe: Multiple Threads Pin
Ha ha ha ha ha ha ha ha30-Sep-08 22:35
Ha ha ha ha ha ha ha ha30-Sep-08 22:35 
QuestionReg:Data Grid Display index and Scrool bar problem Pin
Member 400849230-Sep-08 7:28
Member 400849230-Sep-08 7:28 
AnswerRe: Reg:Data Grid Display index and Scrool bar problem Pin
Mycroft Holmes30-Sep-08 23:06
professionalMycroft Holmes30-Sep-08 23:06 
QuestionGet FileInfo of an Audio [modified] Pin
schiebel-t30-Sep-08 7:09
schiebel-t30-Sep-08 7:09 
AnswerRe: Get FileInfo of an Audio Pin
Giorgi Dalakishvili30-Sep-08 7:55
mentorGiorgi Dalakishvili30-Sep-08 7:55 
GeneralRe: Get FileInfo of an Audio Pin
schiebel-t1-Oct-08 6:20
schiebel-t1-Oct-08 6:20 
GeneralRe: Get FileInfo of an Audio Pin
Giorgi Dalakishvili1-Oct-08 7:41
mentorGiorgi Dalakishvili1-Oct-08 7:41 
Questionarray[key][value] Pin
nuttynibbles30-Sep-08 6:47
nuttynibbles30-Sep-08 6:47 
AnswerRe: array[key][value] Pin
Dan Neely30-Sep-08 6:58
Dan Neely30-Sep-08 6:58 
GeneralRe: array[key][value] Pin
nuttynibbles30-Sep-08 7:07
nuttynibbles30-Sep-08 7:07 
AnswerRe: array[key][value] Pin
User 665830-Sep-08 7:32
User 665830-Sep-08 7:32 
Questioni2c in C# Pin
barak16048730-Sep-08 6:14
barak16048730-Sep-08 6:14 
Questionprintqueuecollection Pin
arkiboys30-Sep-08 4:33
arkiboys30-Sep-08 4:33 
Questionappending "\" to a string Pin
omlac30-Sep-08 4:05
omlac30-Sep-08 4:05 
AnswerRe: appending "\" to a string Pin
Simon P Stevens30-Sep-08 4:30
Simon P Stevens30-Sep-08 4:30 
GeneralRe: appending "\" to a string Pin
omlac30-Sep-08 4:35
omlac30-Sep-08 4:35 

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.