Why can't I close a window with
This is delegated via
this.Close() errors with...
I'm using exactly the same paradigm to update the forms GU control with no problems (ok there are as it doesn't do it in real time (in VBA it's resolved with DoEvents!, but that's another issue!).
Currently I can't get rid of the progress window when I'm finished with it.
The code that calls the close method via the destructor is in the same class which created it ...
I don't understand the error message or any forum I have found regarding it.
What thread is what? Who's the owning thread? What does this mean.
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
Code:
// close progress
public override void CloseProgress()
{
this.Close();
}
This is delegated via
Code:
private delegate void CloseProgressMsg();
private CloseProgressMsg CloseMsg;
this.CloseMsg = this.Frm.CloseProgress;
public void CloseProgress()
{
this.CloseMsg();
this.Frm = null;
}
this.Close() errors with...
{"The calling thread cannot access this object because a different thread owns it."}
I'm using exactly the same paradigm to update the forms GU control with no problems (ok there are as it doesn't do it in real time (in VBA it's resolved with DoEvents!, but that's another issue!).
Currently I can't get rid of the progress window when I'm finished with it.
The code that calls the close method via the destructor is in the same class which created it ...
Code:
// destructor
~Email()
{
Utils.Msg("Close = " + this.ProgressMsg.Close.ToString());
// Close progress window
if(this.ProgressMsg.Close)
{
Utils.Msg("Trying to close poxy window");
this.ProgressMsg.CloseProgress();
this.ProgressMsg = null;
}
I don't understand the error message or any forum I have found regarding it.
What thread is what? Who's the owning thread? What does this mean.
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music