"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
Hi,
No, you can use any delegate you want.
MethodInvoker is just for invoking parameterless methods.
--
Miha Markic [MVP C#] - DXSquad/RightHand .NET consulting & software
development
miha at rthand com
www.rthand.com
Developer Express newsgroups are for peer-to-peer support.
For direct support from Developer Express, write to (e-mail address removed)
Bug reports should be directed to: (e-mail address removed)
Due to newsgroup guidelines, DX-Squad will not answer anonymous postings.
no, of course not
it doesn't work about 2-5%; most of the time it works...
my delegate declared like
public delegate bool doAction(int param1, long param2, bool param3);
I just found that, from MSDN documentation:
"The delegate can be an instance of EventHandler, in which case the
sender
parameter will contain this control, and the event parameter will
contain
EventArgs.Empty. The delegate can also be an instance of MethodInvoker,
or
any other delegate that takes a void parameter list. A call to an
EventHandler or MethodInvoker delegate will be faster than a call to
another
type of delegate."
It seems that my delegate doesn't match the 'requirement' -- "any other
delegate that takes a void parameter list"
my delegate doesn't takes a void parameter list....but this requirement
seems weird......
If i want a function that takes 3 parameters and return a value.....
Do I really need to use EventHandler and override EventArgs to contains
the
3 parameters and the return value and use invoke?!?!?!?
thank you!
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
Hi babylon,
Could it be that abc is blocking?
--
Miha Markic [MVP C#] - RightHand .NET consulting & software
development
miha at rthand com
www.rthand.com
I have 2 threads.
1 is UI thread, the other is a network receiver thread
when my receiver thread receive something from the network; it will
call
invoke to change some (e.g. add a tree node in treeview) UI
elements.
the way I call invoke:
void abc()
{
if (this.InvokeRequired == true)
{
this.Invoke(new MethodInvoke(abc));
}
else
{
// Update UI
}
}
but i found that sometimes the network receiver thread blocked in
the
statement this.Invoke...
how could this be?
thx!!!