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

C#

 
QuestionWindows authentication Domainname\Userid Pin
krishna nimmalapudi25-Apr-06 9:56
krishna nimmalapudi25-Apr-06 9:56 
AnswerRe: Windows authentication Domainname\Userid Pin
tapsbin25-Apr-06 11:28
tapsbin25-Apr-06 11:28 
GeneralRe: Windows authentication Domainname\Userid Pin
krishna nimmalapudi25-Apr-06 17:01
krishna nimmalapudi25-Apr-06 17:01 
QuestionList groups of AD Pin
yuki1025-Apr-06 8:25
yuki1025-Apr-06 8:25 
AnswerRe: List groups of AD Pin
Christian Graus25-Apr-06 10:05
protectorChristian Graus25-Apr-06 10:05 
QuestionDebugging question. Pin
goldoche25-Apr-06 8:11
goldoche25-Apr-06 8:11 
AnswerRe: Debugging question. Pin
Guffa25-Apr-06 8:18
Guffa25-Apr-06 8:18 
QuestionMultithreading issue Pin
sreevid25-Apr-06 8:00
sreevid25-Apr-06 8:00 
I have a C# windows app. It looks like:
public class FormA
{
private ScanFile_Click
{
bool bSuccess = FormB.DoProcess("C:\textfile.txt");
}
}

public class FormB
{
public FormB
{
InitializeComponent();
}

public static bool DoProcess(string sInputFile)
{
FormB frmLocate= new FormB();
frmLocate.Show(frmParent);
// I want the new thread to finish processing before it comes to the statement below
// so that I can return the correct value to FormA
if(frmLocate.SuccessParsing)
{
strFileDetails = frmLocate.FileDetailArray;
}
return frmLocate.SuccessParsing;
}

private void OnLoad()
{
ParseDelegate calcPi = new ParseDelegate(ParseFile);
calcPi.BeginInvoke(this.m_sInputFile, null, null); // calling a new thread
}

// Worker thread
private void ParseFile(string sInputFile)
{
/* Do some calculations here */
/* I need to periodically update GUI controls */
}

My application is more like the one described in

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms06112002.asp

except that i do not have a button to start the new thread but i have to start the worker thread on load (like shown in my previous comment) and the worker thread communicates with the GUI thread (main thread) (in the ParseFile method ). After the worker thread finishes its work the DoProcess method must exit returning the result.

How should i proceed? Or Is there a better way of doing this?

AnswerRe: Multithreading issue Pin
Judah Gabriel Himango25-Apr-06 11:00
sponsorJudah Gabriel Himango25-Apr-06 11:00 
QuestionInter App Domain Question Pin
Joel Holdsworth25-Apr-06 7:13
Joel Holdsworth25-Apr-06 7:13 
AnswerRe: Inter App Domain Question Pin
Judah Gabriel Himango25-Apr-06 11:08
sponsorJudah Gabriel Himango25-Apr-06 11:08 
GeneralRe: Inter App Domain Question Pin
Joel Holdsworth25-Apr-06 22:25
Joel Holdsworth25-Apr-06 22:25 
AnswerRe: Inter App Domain Question Pin
Nicholas Butler25-Apr-06 21:20
sitebuilderNicholas Butler25-Apr-06 21:20 
QuestionRemoting timeout Issue Pin
kotteeswaran25-Apr-06 7:11
kotteeswaran25-Apr-06 7:11 
QuestionCustom controls localization Pin
Dario Solera25-Apr-06 5:27
Dario Solera25-Apr-06 5:27 
AnswerRe: Custom controls localization Pin
Ed.Poore25-Apr-06 11:30
Ed.Poore25-Apr-06 11:30 
GeneralRe: Custom controls localization Pin
Dario Solera25-Apr-06 20:42
Dario Solera25-Apr-06 20:42 
QuestionPlug-in with C# Pin
hung_ngole25-Apr-06 5:20
hung_ngole25-Apr-06 5:20 
QuestionWhat is difference Between Function Overloading and delegates in C# Pin
Ut Rahul25-Apr-06 5:03
Ut Rahul25-Apr-06 5:03 
AnswerRe: What is difference Between Function Overloading and delegates in C# Pin
Guffa25-Apr-06 5:10
Guffa25-Apr-06 5:10 
AnswerRe: What is difference Between Function Overloading and delegates in C# Pin
Tom Larsen25-Apr-06 5:22
Tom Larsen25-Apr-06 5:22 
GeneralRe: What is difference Between Function Overloading and delegates in C# Pin
Guffa25-Apr-06 7:15
Guffa25-Apr-06 7:15 
QuestionConvertion of String to HTML Pin
VenkataRamana.Gali25-Apr-06 4:48
VenkataRamana.Gali25-Apr-06 4:48 
AnswerRe: Convertion of String to HTML Pin
leppie25-Apr-06 6:48
leppie25-Apr-06 6:48 
AnswerRe: Convertion of String to HTML Pin
malharone25-Apr-06 6:54
malharone25-Apr-06 6:54 

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.