473,903 Members | 4,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.or g

Dec 23 '05 #1
4 1183
Stu <st**********@u niv.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.co m>
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.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Stu <st**********@u niv.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.co m>
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.co m>
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**********@u niv.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.co m>
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
10807
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 = "link1" ctrl.Text = "link create" ctrl.CommandArgument = "myargument"
0
1774
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 control but can to get them to retain view state. Below is a striped down version of my control. It exposes one property of type System.Web.UI.Control that the containing page my set with a dynamically created control My custom control will then...
4
3125
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 UserControls into the PlaceHolder's child control collection depending upon which of the three radio buttons is selected. Each of the three UserControls have postback events themselves triggered by button clicks. The problem I'm having is keeping track of...
3
2413
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 reuseable code, as well as application-specific objects which usually make use of our core objects. What I'd like to do is get some sort of count to see how often our core objects are used by our applications.
6
6886
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 plugin in a separate sub-dir inside a "Plugins" directory. Each plugin consists of at least two DLLs (a controller and a driver). However, most drivers also rely on other external DLLs. In one particular case this dependency is to a C++ DLL...
5
3083
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 and the specific type of control frequently changes. I have a common event in the base class that each child user control inherits from and that the page wires up and uses to get status from the child user control. I hope all pretty simple and not...
2
1434
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 required? TIA David McCallum
0
877
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. eg: A.dll, B.dll, C.dll are the dlls and GetVersion functions are as:
0
895
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, function_name) -- Gabriel Genellina
0
10007
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9854
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9693
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7215
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5899
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6100
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3329
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.