473,396 Members | 2,010 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.

Dynamically load child DLLs?

Stu
Hi,

I'm looking at making a piece of software which will have a central
executable file, and a list of DLLs (kind of like Office "add-ins")
that will provide different functionalities - the idea being I can
write new modules as and when they're needed, and distribute them to
customers as necessary.

Could anyone provide any advice as to the best way to go about this? I
was thinking a list of "installed" modules could be stored in the
registry. I'm then hoping that I could do something along the lines of
loop through the list, and create an array of "modules" by referring to
different objects in different DLLs.

Is it possible to load a DLL by name, and create an instance of an
object by name (i.e. dynamically, at runtime - not at designtime)? If
so, how do I do this? I'm envisaging that all modules will have
objects implementing the same interface.

Thank you in advance for your help!

Stuart Jones
To e-mail me, replace the part of my e-mail after the @ with
university-college.oxon.org

Dec 23 '05 #1
4 1163
Stu <st**********@univ.ox.ac.uk> wrote:
I'm looking at making a piece of software which will have a central
executable file, and a list of DLLs (kind of like Office "add-ins")
that will provide different functionalities - the idea being I can
write new modules as and when they're needed, and distribute them to
customers as necessary.

Could anyone provide any advice as to the best way to go about this? I
was thinking a list of "installed" modules could be stored in the
registry. I'm then hoping that I could do something along the lines of
loop through the list, and create an array of "modules" by referring to
different objects in different DLLs.

Is it possible to load a DLL by name, and create an instance of an
object by name (i.e. dynamically, at runtime - not at designtime)? If
so, how do I do this? I'm envisaging that all modules will have
objects implementing the same interface.

Thank you in advance for your help!


Have a look at http://www.pobox.com/~skeet/csharp/plugin.html

It's mostly for people who are already having problems, but it gives
you a little bit of framework to see what you need to do.

(You have my sympathy by the way - but I suppose someone has to go to
Oxford ;)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 23 '05 #2
Have a look at articles I wrote in September 2003 and August 2005 from
http://emoreau.s2i.com/

--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Concept S2i inc. (www.s2i.com)
http://emoreau.s2i.com/

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Stu <st**********@univ.ox.ac.uk> wrote:
I'm looking at making a piece of software which will have a central
executable file, and a list of DLLs (kind of like Office "add-ins")
that will provide different functionalities - the idea being I can
write new modules as and when they're needed, and distribute them to
customers as necessary.

Could anyone provide any advice as to the best way to go about this? I
was thinking a list of "installed" modules could be stored in the
registry. I'm then hoping that I could do something along the lines of
loop through the list, and create an array of "modules" by referring to
different objects in different DLLs.

Is it possible to load a DLL by name, and create an instance of an
object by name (i.e. dynamically, at runtime - not at designtime)? If
so, how do I do this? I'm envisaging that all modules will have
objects implementing the same interface.

Thank you in advance for your help!


Have a look at http://www.pobox.com/~skeet/csharp/plugin.html

It's mostly for people who are already having problems, but it gives
you a little bit of framework to see what you need to do.

(You have my sympathy by the way - but I suppose someone has to go to
Oxford ;)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Dec 23 '05 #3
Stu
Eric Moreau wrote:
Have a look at articles I wrote in September 2003 and August 2005 from
http://emoreau.s2i.com/
Have a look at http://www.pobox.com/~skeet/csharp/plugin.html

It's mostly for people who are already having problems, but it gives
you a little bit of framework to see what you need to do.

(You have my sympathy by the way - but I suppose someone has to go to
Oxford ;)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Thank you both for your help - it's exactly the sort of stuff I had in
mind :-)

Have a peaceful Christmas and a prosperous New Year!

(And as for Oxford - I just never liked Cambridge's nasty duck-egg blue
from an early age...)

Dec 23 '05 #4
Stu <st**********@univ.ox.ac.uk> wrote:
Thank you both for your help - it's exactly the sort of stuff I had in
mind :-)
My pleasure. Do ask if anything else goes wrong - in my experience,
it's rare to get this kind of thing working first time :)
Have a peaceful Christmas and a prosperous New Year!
Likewise.
(And as for Oxford - I just never liked Cambridge's nasty duck-egg blue
from an early age...)


Yeah. I think we let you have the nicer colour to make up for
everything else.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Dec 23 '05 #5

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

Similar topics

8
by: simon | last post by:
On code behind file: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then Dim ctrl As New LinkButton ctrl.ID =...
0
by: Earl Teigrob | last post by:
I am building a custom control that I want to server as a container for child controls that can be dynamically added to this control. I can persist the child controls that are added to my custom...
4
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three...
3
by: Adman | last post by:
Hi all... At my work, we have a large number of dlls. Each dll is typically a single class, and each class has any number of methods in it. We have "core" objects that generally contain...
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...
5
by: Andrew Robinson | last post by:
I have a page that can load a number of different user controls. Each of these user controls inherits from a common base class and the controls are loaded based on application state, status, etc...
2
by: David McCallum | last post by:
I'm not infront of my computer just now, but I seem to remember when my app is being executed the output console shows all the DLLs being loaded. Is there anyway to load these DLLs as and when...
0
by: dudeja.rajat | last post by:
Hi, I'm using the ctypes module to load my dlls. I have some 10 dlls the names of those are passed to a fucntion which then loads the passed dll. Now every dll has a getversion function....
0
by: Gabriel Genellina | last post by:
En Tue, 26 Aug 2008 07:42:50 -0300, <dudeja.rajat@gmail.comescribi�: Use getattr - same as with any other object. Suppose some_dll is your loaded DLL, then: function = getattr(some_dll,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.