473,326 Members | 2,588 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,326 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 1455
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.