S
Sean Aitken
Good Morning,
I am having an interesting problem. I am calling a method on a form
asynchronously through a delegate. In this case a loop to update a
progress bar:
private void UpdateUILoop()
{
for (int i = 0; i < 100; i++)
{
Thread.Sleep(3000 / 100);
this.Invoke(this.setProgDel, i);
}
}
(setProgDel simply sets the value of the progress bar)
Using BeginInvoke from a delegate seems to run through the Remoting
namespace (?).. but the wost of it is the inability to debug the
method invoked through BeginInvoke. When a breakpoint is set inside
the method, the IDE pauses (usually), then once the breakpoint is hit
and a continue is attempted, the thread is dead!
Has anyone seen this or knows why this is happening? I'm about to
refactor the solution so that BeginInvoke is not used, but I'd still
like to understand whats going on.
Best regards,
-Sean
I am having an interesting problem. I am calling a method on a form
asynchronously through a delegate. In this case a loop to update a
progress bar:
private void UpdateUILoop()
{
for (int i = 0; i < 100; i++)
{
Thread.Sleep(3000 / 100);
this.Invoke(this.setProgDel, i);
}
}
(setProgDel simply sets the value of the progress bar)
Using BeginInvoke from a delegate seems to run through the Remoting
namespace (?).. but the wost of it is the inability to debug the
method invoked through BeginInvoke. When a breakpoint is set inside
the method, the IDE pauses (usually), then once the breakpoint is hit
and a continue is attempted, the thread is dead!
Has anyone seen this or knows why this is happening? I'm about to
refactor the solution so that BeginInvoke is not used, but I'd still
like to understand whats going on.
Best regards,
-Sean