G
Guest
Wow... unbelieveable that this problem would arise right before giving the
software to our public testers... or maybe it is believable. We tweaked some
seemingly unrelated code somewhere else having nothing to to with this
object, and now the following function is causing a
System.StackOverflowException:
private void ResetAllDataFieldsSafely()
{
if(myWebBrowser.InvokeRequired) //always evaluates to true
{
SafelyResetAllDataFieldsDD d = new
SafelyResetAllDataFieldsDD(ResetAllDataFieldsSafely);
this.Invoke(d);
}
else
{ // now this should be running on the main GUI thread
ResetAllDataFields();
}
} // end ResetAllDataFieldsSafely ()
myWebBrowser.InvokeRequired always is true now! I will watch it in debug
mode and indeed this is an infinite loop. Why on earth is this happening?
Is there something strange you can do to a web browser object that will
always cause it to evaluate to true? I am calling ResetAllDataFieldsSafely()
from another thread.
It worked before...
Thanks to anyone and everyone who reads this,
Rob K
software to our public testers... or maybe it is believable. We tweaked some
seemingly unrelated code somewhere else having nothing to to with this
object, and now the following function is causing a
System.StackOverflowException:
private void ResetAllDataFieldsSafely()
{
if(myWebBrowser.InvokeRequired) //always evaluates to true
{
SafelyResetAllDataFieldsDD d = new
SafelyResetAllDataFieldsDD(ResetAllDataFieldsSafely);
this.Invoke(d);
}
else
{ // now this should be running on the main GUI thread
ResetAllDataFields();
}
} // end ResetAllDataFieldsSafely ()
myWebBrowser.InvokeRequired always is true now! I will watch it in debug
mode and indeed this is an infinite loop. Why on earth is this happening?
Is there something strange you can do to a web browser object that will
always cause it to evaluate to true? I am calling ResetAllDataFieldsSafely()
from another thread.
It worked before...
Thanks to anyone and everyone who reads this,
Rob K