Click here to Skip to main content
15,889,882 members
Home / Discussions / C#
   

C#

 
AnswerRe: Arrays in C# Pin
Nouman Bhatti3-May-07 21:09
Nouman Bhatti3-May-07 21:09 
AnswerRe: Arrays in C# Pin
AFSEKI7-May-07 4:13
AFSEKI7-May-07 4:13 
QuestionPassing Parameters to a running thread Pin
Christopher Thornburg3-May-07 9:34
Christopher Thornburg3-May-07 9:34 
AnswerRe: Passing Parameters to a running thread Pin
pbraun3-May-07 11:03
pbraun3-May-07 11:03 
GeneralRe: Passing Parameters to a running thread Pin
Christopher Thornburg3-May-07 11:06
Christopher Thornburg3-May-07 11:06 
GeneralRe: Passing Parameters to a running thread Pin
pbraun3-May-07 11:14
pbraun3-May-07 11:14 
AnswerRe: Passing Parameters to a running thread Pin
Stefan Prodan3-May-07 12:01
Stefan Prodan3-May-07 12:01 
AnswerRe: Passing Parameters to a running thread Pin
AFSEKI7-May-07 4:30
AFSEKI7-May-07 4:30 
Use:

Thread.Start(object) method as:

public void Start (
Object parameter
)

where you pass a static or a dynamic but(reference is kept to prevent garbage collection "WeakReference can also be considered for this case") object which includes your parameters that you can change while the thread is running.

ALSO, searching a Thread by it's name is not preferred, try keeping a reference to each thread you create, better an integer value or byte(if you don't have more than 255 threads in your application Wink | ;) ) and access these threads with these indexes. You can also use a Dictionary<string threadname,="" thread="" threadinstance="">, anyway.

As a result you can modify your parameters in the objectargument you pass and also keep a reference of in you main thread. BUT, be careful chosing and a using a type for your object argument. If you are using value types, modify the real data accessing it through "ref" keyword.
QuestionMSI Database Functions in C# Pin
CyberTech3-May-07 7:55
CyberTech3-May-07 7:55 
QuestionHow to add user to the folder? Pin
Dotnetkanna3-May-07 6:55
Dotnetkanna3-May-07 6:55 
AnswerRe: How to add user to the folder? Pin
Tarakeshwar Reddy3-May-07 7:21
professionalTarakeshwar Reddy3-May-07 7:21 
QuestionKnown issues with WebBrowser control? Pin
engsrini3-May-07 5:46
engsrini3-May-07 5:46 
AnswerRe: Known issues with WebBrowser control? Pin
PIEBALDconsult3-May-07 8:05
mvePIEBALDconsult3-May-07 8:05 
QuestionDeveloping Mobile Phone Applications using C# Pin
Nadia Monalisa3-May-07 4:46
Nadia Monalisa3-May-07 4:46 
AnswerRe: Developing Mobile Phone Applications using C# Pin
Dave Kreskowiak3-May-07 4:54
mveDave Kreskowiak3-May-07 4:54 
QuestionButton.Text has no effect? Pin
User 66583-May-07 4:37
User 66583-May-07 4:37 
AnswerRe: Button.Text has no effect? Pin
Sandeep Akhare3-May-07 4:43
Sandeep Akhare3-May-07 4:43 
AnswerRe: Button.Text has no effect? Pin
Dave Kreskowiak3-May-07 4:53
mveDave Kreskowiak3-May-07 4:53 
GeneralRe: Button.Text has no effect? Pin
Sandeep Akhare3-May-07 5:08
Sandeep Akhare3-May-07 5:08 
GeneralRe: Button.Text has no effect? Pin
Dave Kreskowiak3-May-07 5:35
mveDave Kreskowiak3-May-07 5:35 
GeneralRe: Button.Text has no effect? Pin
User 66583-May-07 6:13
User 66583-May-07 6:13 
GeneralRe: Button.Text has no effect? Pin
Dave Kreskowiak3-May-07 6:57
mveDave Kreskowiak3-May-07 6:57 
AnswerRe: Button.Text has no effect? Pin
MoustafaS3-May-07 6:15
MoustafaS3-May-07 6:15 
AnswerRe: Button.Text has no effect? Pin
Stefan Prodan3-May-07 12:05
Stefan Prodan3-May-07 12:05 
QuestionConcept of Thread.BeginCriticalRegion() Pin
Sandeep Akhare3-May-07 4:28
Sandeep Akhare3-May-07 4:28 

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.