Re: Plugin Architecture Question - Best Practice For Forms Update
- From: "Bob Powell [MVP]" <bob@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 14 Oct 2005 11:59:45 +0200
DLL's used by an EXE don't run on a separate thread. The DLL usually runs on
the EXE's thread. This means that your normal event handling systems work
just fine. Remember that things like TextBoxes and indeed the Form base
class are held in a DLL that's used by your EXE.
Timers such as System.Threading.Timer do indeed notify of timeouts on a
different thread. In cases where you use the more reliable timers you must
invoke correctly.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"cab0san" <cabosan@xxxxxxxxx> wrote in message
news:1129258710.215818.307320@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Plugin Architecture Question - Best Practice For Forms Update
>
>
>
> I have an application that follows a simple plugin architecture. Yes,
> it is my first plugin app, so please bear with me. There is an
> interface defined, and followed by the host exe and plugin (or client)
> dll. The plugins reach out into the world and get bits of information
> (stock prices, new mail, disk space, rss feeds... whatever) these bits
> of information end up as treenodes in a treeview in the host app.
>
> My question is:
>
> When a plugin is ready to deliver updated content, say perhaps by use
> of a timer, what is the preferred way of notifying the host app?
>
> (assuming that my plugin will be in a seperate thread)
> Should I pass a reference to the form?
> Do I raise an event?
>
>
> I know that you should operate on winforms in the originating thread
> only , so they don't play well with refreshes sent from timer threads
> (or any other thread). I am able to use invoke to get around a few
> things, but I was hoping to find a simpler solution, and wanted to hear
> some opinions.
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: Activating another process
- Next by Date: Re: Invisible combobox.
- Previous by thread: Plugin Architecture Question - Best Practice For Forms Update
- Next by thread: Re: Plugin Architecture Question - Best Practice For Forms Update
- Index(es):
Relevant Pages
|
Loading