P
Paul Tomlinson
I am trying to call a delegate on my parent from a child thread, this is my
code, however i'm getting an exception "Object type cannot be converted to
target type." which I can't understand. The prototype for my delegate is:
public delegate void ExceptionDelegate( object[] o ); // called from all
child threads
This is the offending code. Can anyone shed any light please?
if( myParent.InvokeRequired )
{
myParent.Invoke( myParent.MessageOnException, new object[] {
e.Message } );
}
else
{
myParent.MessageOnException( new object[] { e.Message } );
}
code, however i'm getting an exception "Object type cannot be converted to
target type." which I can't understand. The prototype for my delegate is:
public delegate void ExceptionDelegate( object[] o ); // called from all
child threads
This is the offending code. Can anyone shed any light please?
if( myParent.InvokeRequired )
{
myParent.Invoke( myParent.MessageOnException, new object[] {
e.Message } );
}
else
{
myParent.MessageOnException( new object[] { e.Message } );
}