473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HOW TO: Use user defined DLLs as plugins

Situation:
An EXE scans the path for DLLs and uses all DLLs and only the
existing DLLs
All DLLs provides the same functions while doing different processing
Program restart is NOT desired

Question:
How to declare the DLLs functions for a end user selected DLL?

Nov 20 '05 #1
9 1457
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has their own
purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Situation:
An EXE scans the path for DLLs and uses all DLLs and only the
existing DLLs
All DLLs provides the same functions while doing different processing
Program restart is NOT desired

Question:
How to declare the DLLs functions for a end user selected DLL?

Nov 20 '05 #2
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has their own
purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Situation:
An EXE scans the path for DLLs and uses all DLLs and only the
existing DLLs
All DLLs provides the same functions while doing different processing
Program restart is NOT desired

Question:
How to declare the DLLs functions for a end user selected DLL?

Nov 20 '05 #3
that made no sense...

You should use Interfaces when developing plugin frameworks, so you dont
have any misplaced DLL's in your search directory. Reflection allows you
get info about the dll you are trying to dynamically load.
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has their own purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Situation:
An EXE scans the path for DLLs and uses all DLLs and only the
existing DLLs
All DLLs provides the same functions while doing different processing Program restart is NOT desired

Question:
How to declare the DLLs functions for a end user selected DLL?


Nov 20 '05 #4
that made no sense...

You should use Interfaces when developing plugin frameworks, so you dont
have any misplaced DLL's in your search directory. Reflection allows you
get info about the dll you are trying to dynamically load.
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has their own purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Situation:
An EXE scans the path for DLLs and uses all DLLs and only the
existing DLLs
All DLLs provides the same functions while doing different processing Program restart is NOT desired

Question:
How to declare the DLLs functions for a end user selected DLL?


Nov 20 '05 #5
I couldn't ever get the Interfaces to work right, so I went with ClassByName
approach. The only problem with plugins under .NET, and I will never tire
of saying this, is the damned GarbageCollector! You can't "unload" the
DLL's untill the GC either decides you are actually done with them, or you
do a GC.Collect and forcec it to, which can really hinder perfomance.
Anyhew, a google or dogpile search will return thousands of pages on how to
do plugins. I've heard the Interfaces is the way to go, so go with that.
just cause I couldn't get it to work for my situation, doesn't mean that
it's not perfect for you. Food for thought.

Sueffel
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OC*************@tk2msftngp13.phx.gbl...
that made no sense...

You should use Interfaces when developing plugin frameworks, so you dont
have any misplaced DLL's in your search directory. Reflection allows you
get info about the dll you are trying to dynamically load.
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has their

own
purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Situation:
An EXE scans the path for DLLs and uses all DLLs and only the
existing DLLs
All DLLs provides the same functions while doing different processing Program restart is NOT desired

Question:
How to declare the DLLs functions for a end user selected DLL?



Nov 20 '05 #6
I couldn't ever get the Interfaces to work right, so I went with ClassByName
approach. The only problem with plugins under .NET, and I will never tire
of saying this, is the damned GarbageCollector! You can't "unload" the
DLL's untill the GC either decides you are actually done with them, or you
do a GC.Collect and forcec it to, which can really hinder perfomance.
Anyhew, a google or dogpile search will return thousands of pages on how to
do plugins. I've heard the Interfaces is the way to go, so go with that.
just cause I couldn't get it to work for my situation, doesn't mean that
it's not perfect for you. Food for thought.

Sueffel
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OC*************@tk2msftngp13.phx.gbl...
that made no sense...

You should use Interfaces when developing plugin frameworks, so you dont
have any misplaced DLL's in your search directory. Reflection allows you
get info about the dll you are trying to dynamically load.
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has their

own
purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Situation:
An EXE scans the path for DLLs and uses all DLLs and only the
existing DLLs
All DLLs provides the same functions while doing different processing Program restart is NOT desired

Question:
How to declare the DLLs functions for a end user selected DLL?



Nov 20 '05 #7
You know, I understand what you mean by that. That was one of the
challenges I ran across when doing my first plugin framework, it worked
fantastic if I had like 2 to 3 small plugins but as more were added it just
became slower and slower.

Now in my framework I wanted to get menu's,statusbars, etc... stuff the was
required to be persisted. Not a problem by keeping a reference to it. So,
I just developed numerous interfaces and left it up to good design by the
user. The goal, was that classes that needed to be run were instantiated
dynamically when needed, not load them all at the beginning like a lot of
frameworks do (one bad entry point can be the difference between a few megs
and 40 megs. =)

So I understand where your going with diffuculty with interfaces, but just a
little bit of work and you'll get it there. They really are quite powerful.

another useless rant...

-CJ
"Sueffel" <so*****@somewhere.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
I couldn't ever get the Interfaces to work right, so I went with ClassByName approach. The only problem with plugins under .NET, and I will never tire
of saying this, is the damned GarbageCollector! You can't "unload" the
DLL's untill the GC either decides you are actually done with them, or you
do a GC.Collect and forcec it to, which can really hinder perfomance.
Anyhew, a google or dogpile search will return thousands of pages on how to do plugins. I've heard the Interfaces is the way to go, so go with that.
just cause I couldn't get it to work for my situation, doesn't mean that
it's not perfect for you. Food for thought.

Sueffel
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OC*************@tk2msftngp13.phx.gbl...
that made no sense...

You should use Interfaces when developing plugin frameworks, so you dont
have any misplaced DLL's in your search directory. Reflection allows you get info about the dll you are trying to dynamically load.
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has
their own
purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> Situation:
> An EXE scans the path for DLLs and uses all DLLs and only the
> existing DLLs
> All DLLs provides the same functions while doing different

processing
> Program restart is NOT desired
>
> Question:
> How to declare the DLLs functions for a end user selected DLL?
>



Nov 20 '05 #8
You know, I understand what you mean by that. That was one of the
challenges I ran across when doing my first plugin framework, it worked
fantastic if I had like 2 to 3 small plugins but as more were added it just
became slower and slower.

Now in my framework I wanted to get menu's,statusbars, etc... stuff the was
required to be persisted. Not a problem by keeping a reference to it. So,
I just developed numerous interfaces and left it up to good design by the
user. The goal, was that classes that needed to be run were instantiated
dynamically when needed, not load them all at the beginning like a lot of
frameworks do (one bad entry point can be the difference between a few megs
and 40 megs. =)

So I understand where your going with diffuculty with interfaces, but just a
little bit of work and you'll get it there. They really are quite powerful.

another useless rant...

-CJ
"Sueffel" <so*****@somewhere.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
I couldn't ever get the Interfaces to work right, so I went with ClassByName approach. The only problem with plugins under .NET, and I will never tire
of saying this, is the damned GarbageCollector! You can't "unload" the
DLL's untill the GC either decides you are actually done with them, or you
do a GC.Collect and forcec it to, which can really hinder perfomance.
Anyhew, a google or dogpile search will return thousands of pages on how to do plugins. I've heard the Interfaces is the way to go, so go with that.
just cause I couldn't get it to work for my situation, doesn't mean that
it's not perfect for you. Food for thought.

Sueffel
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OC*************@tk2msftngp13.phx.gbl...
that made no sense...

You should use Interfaces when developing plugin frameworks, so you dont
have any misplaced DLL's in your search directory. Reflection allows you get info about the dll you are trying to dynamically load.
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
You have to use the System.Reflection namespace. Look into using
interfaces, I've developed 4 different plugin frameworks, each has
their own
purpose.
"M. Angelo" <So***@No.One> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> Situation:
> An EXE scans the path for DLLs and uses all DLLs and only the
> existing DLLs
> All DLLs provides the same functions while doing different

processing
> Program restart is NOT desired
>
> Question:
> How to declare the DLLs functions for a end user selected DLL?
>



Nov 20 '05 #9
And thence such a cry didst arrise from the gathered masses. "Show unto us
the code which came from thy great swollen mellon of a brain, that we may
copy it, and claim it as our own, and use it, and gain royalties from it,
and have our users think that we wrote this magnificent code, all the while
knowing in our hearts that it is yours, and you wrote it, and it came from
thine great and swollen mellon of a brain."

And thence CJ Taylor gave us the code by which we might all implement his
great and magnificent scheme.
......
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:ug**************@tk2msftngp13.phx.gbl...
You know, I understand what you mean by that. That was one of the
challenges I ran across when doing my first plugin framework, it worked
fantastic if I had like 2 to 3 small plugins but as more were added it just became slower and slower.

Now in my framework I wanted to get menu's,statusbars, etc... stuff the was required to be persisted. Not a problem by keeping a reference to it. So, I just developed numerous interfaces and left it up to good design by the
user. The goal, was that classes that needed to be run were instantiated
dynamically when needed, not load them all at the beginning like a lot of
frameworks do (one bad entry point can be the difference between a few megs and 40 megs. =)

So I understand where your going with diffuculty with interfaces, but just a little bit of work and you'll get it there. They really are quite powerful.
another useless rant...

-CJ
"Sueffel" <so*****@somewhere.com> wrote in message
news:u%****************@TK2MSFTNGP09.phx.gbl...
I couldn't ever get the Interfaces to work right, so I went with

ClassByName
approach. The only problem with plugins under .NET, and I will never tire
of saying this, is the damned GarbageCollector! You can't "unload" the
DLL's untill the GC either decides you are actually done with them, or you do a GC.Collect and forcec it to, which can really hinder perfomance.
Anyhew, a google or dogpile search will return thousands of pages on how

to
do plugins. I've heard the Interfaces is the way to go, so go with that. just cause I couldn't get it to work for my situation, doesn't mean that
it's not perfect for you. Food for thought.

Sueffel
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com>
wrote in message news:OC*************@tk2msftngp13.phx.gbl...
that made no sense...

You should use Interfaces when developing plugin frameworks, so you dont have any misplaced DLL's in your search directory. Reflection allows

you get info about the dll you are trying to dynamically load.
"CJ Taylor" <cege at remve this part tavayn yeah this part too dot com> wrote in message news:OO**************@TK2MSFTNGP10.phx.gbl...
> You have to use the System.Reflection namespace. Look into using
> interfaces, I've developed 4 different plugin frameworks, each has their own
> purpose.
>
>
> "M. Angelo" <So***@No.One> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
> > Situation:
> > An EXE scans the path for DLLs and uses all DLLs and only the
> > existing DLLs
> > All DLLs provides the same functions while doing different
processing
> > Program restart is NOT desired
> >
> > Question:
> > How to declare the DLLs functions for a end user selected DLL? > >
>
>



Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: YZK | last post by:
Hello. I'm not a Web developer, just a user, and I think I may have somehow messed myself up majorly. I'm not quite sure how. Right now, javascript used by websites I go to either does not work at...
0
by: David Krmpotic | last post by:
Hello! I have a simple client/server plugin based architecture. I place all the plugins in \plugins sub-directory on both, server and the client. Each DLL has implemented two interfaces.. on for...
1
by: mphanke | last post by:
Hi, I have a question concerning the search order of DLLs and whether I can take influence on how they are loaded. The following is my situation: I have a plugin design for my application....
0
by: Oenone | last post by:
I have created a number of "plug-in" DLLs for my ASP.NET application which are dynamically loaded at run-time. This is done by locating the DLL file on disk and loading it using the...
8
by: M. Angelo | last post by:
Situation: An EXE scans the path for DLLs and uses all DLLs and only the existing DLLs All DLLs provides the same functions while doing different processing Program restart is NOT desired ...
3
by: Hector Y. Martinez | last post by:
Hi everybody... my problem is: Well I want to make an app, that you the user could add some plugins (DLLs)... this plugins can contains classes that inherit from one class in my app, of course the...
3
by: Benny Raymond | last post by:
I have my auto update and auto update/ download new plugins system working. The only thing I'm missing now is the ability to "uninstall" plugins that are currently installed. Currently I'm...
6
by: Dan Dorey | last post by:
I actually have two questions here, but I'll start by giving an outline of what I'm trying to do. I'm building an app with a simple plugin architecture (all in the same app domain). I have each...
6
by: Rene Sørensen | last post by:
Is there a way to decide where all my class libraries (dlls) are located instead of just having them in the same directory as the main application? What I'm thinking is to have a directory...
0
by: treefrog | last post by:
Greetings, I have a C# application that uses Reflection to scan through a directory, ./plugins/, for assemblies that have been assigned the PluginAttribute and loads them. This part works...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.