I've created a custom component that is derived from the Component
class. This component can be added to a form. What I've noticed is
that I run into problems if I call methods on the component from a
different thread than the one in which it was created.

I'm aware that you should never access a windows form control from
another thread but should call the parent form's Invoke or
BeginInvoke methods passing them a delegate they can call that will
in turn access the control.

Does this apply to custom components as well?

If so, is this documented any where?

Re: Custom Components, Threads, and Invoke by Sijin

Sijin
Sun Aug 08 02:46:32 CDT 2004

At the heart all windows apps still rely on the message pump to work. Since
the message pump is thread specifc any functionality which relies on
messages will need to be executed on the thread that has the message pump.
That is why the need arises to use Invoke() etc.

--
Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph


"Wavemaker" <jabberdabber@BiteMeHotmail.com> wrote in message
news:hIadnaTlV6mbioncRVn-jQ@comcast.com...
> I've created a custom component that is derived from the Component
> class. This component can be added to a form. What I've noticed is
> that I run into problems if I call methods on the component from a
> different thread than the one in which it was created.
>
> I'm aware that you should never access a windows form control from
> another thread but should call the parent form's Invoke or
> BeginInvoke methods passing them a delegate they can call that will
> in turn access the control.
>
> Does this apply to custom components as well?
>
> If so, is this documented any where?
>
>