L
Lloyd Dupont
I have a program which use multithread.
Inadvertently dare I say, as they are not my threads but those of a FileSystemWatcher.
Anyway some method get called on my GUI.
I rewrite the code in such a way that it should only be to a funtion like that:
void HTreeChanged(object sender, TreeEventArgs e)
{
if(base.Created)
BeginInvoke(new Action(Invalidate));
}
however there is, apparently, another method call on an other thread.
the problem is I have no idea which one and VS.NET popup a message box saying:
System.InvalidOperationException was unhandled
Message: Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on.
but even though I looked at all the active thread's stack I have no idea which method is throwing..
what can I do?
Inadvertently dare I say, as they are not my threads but those of a FileSystemWatcher.
Anyway some method get called on my GUI.
I rewrite the code in such a way that it should only be to a funtion like that:
void HTreeChanged(object sender, TreeEventArgs e)
{
if(base.Created)
BeginInvoke(new Action(Invalidate));
}
however there is, apparently, another method call on an other thread.
the problem is I have no idea which one and VS.NET popup a message box saying:
System.InvalidOperationException was unhandled
Message: Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on.
but even though I looked at all the active thread's stack I have no idea which method is throwing..
what can I do?