G
Guest
Trying my first project with a thread. I have a windows application in which
I want to call this class which does a bunch of processing using a thread.
My application validates the values supplied on the input and when all is
well, it displays a message on the screen to indicate that the process is
underway and then it creates the thread.
So when I place a Debug stop on the method I call ThreadStart(MyMethod), the
debugger stops on the line I have designated, but when I press the key to
navigate to the next instruction to process, nothing happens. The line I am
stopped on instantiates a class which does all of the processing. I can't
step into that process and it never comes back from that process. Here is a
snipit of the code.....
private void cmdRun_Click(object sender, EventArgs e)
{
Thread oThread = new Thread(new ThreadStart(GenerateComboEditHtmlPages)
);
oThread.Name = "ComboHtlmReport";
oThread.Start();
}
private void GenerateComboEditHtmlPages()
{
ComboEditReport editReport = new ComboEditReport(_HtmlOutputLoc,
_RuleDescLoc, _Environment, _CoverPage);
cmdRun.Enabled = true;
if (editReport.ProcessSuccessful)
{ lblStatus.Text = "The request completed successfully"; }
else
{ lblStatus.Text = " **** The request was unsucessful *****" +
Environment.NewLine + "Detail Error Msg: " + editReport.Messages; }
panel1.Visible = true;
}
So what am I doing wrong?
I want to call this class which does a bunch of processing using a thread.
My application validates the values supplied on the input and when all is
well, it displays a message on the screen to indicate that the process is
underway and then it creates the thread.
So when I place a Debug stop on the method I call ThreadStart(MyMethod), the
debugger stops on the line I have designated, but when I press the key to
navigate to the next instruction to process, nothing happens. The line I am
stopped on instantiates a class which does all of the processing. I can't
step into that process and it never comes back from that process. Here is a
snipit of the code.....
private void cmdRun_Click(object sender, EventArgs e)
{
Thread oThread = new Thread(new ThreadStart(GenerateComboEditHtmlPages)
);
oThread.Name = "ComboHtlmReport";
oThread.Start();
}
private void GenerateComboEditHtmlPages()
{
ComboEditReport editReport = new ComboEditReport(_HtmlOutputLoc,
_RuleDescLoc, _Environment, _CoverPage);
cmdRun.Enabled = true;
if (editReport.ProcessSuccessful)
{ lblStatus.Text = "The request completed successfully"; }
else
{ lblStatus.Text = " **** The request was unsucessful *****" +
Environment.NewLine + "Detail Error Msg: " + editReport.Messages; }
panel1.Visible = true;
}
So what am I doing wrong?