Max Adams <rubberducky703@hotmail.com> wrote:[color=blue]
> Question about using delegates with a string paramater to return a
> ListViewItem object...
>
> All,
>
> I have a thread and I want this thread to post messages to the main GUI
> thread using a delegate. This is my code fragment:
>
> ListViewItem lview = m_form.Invoke( m_form.m_DelegateAddItem, new object[]
> {"hello"} );
>
> This does not compile[/color]
When saying that something doesn't compile, *always* say what the
compilation error is.
In this case, at a guess, just casting the return value of
m_form.Invoke to ListViewItem will solve things. If it doesn't,
could you post a short but complete program which demonstrates the
problem?
See
http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too