473,385 Members | 1,912 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,385 software developers and data experts.

Plug-ins and Late binding

Hi,
I have some code to load some plug-ins, but the code requires me to know
the name of the class to load (here: SamplePlugin, derived from IPlugin) :

using System;
using System.Reflection;

public class Driver
{
static void Main()
{
Assembly assembly = Assembly.LoadFrom ("myplugin.dll");
Type t = assembly.GetType ("SamplePlugin");
IPlugin plugin = (IPlugin) Activator.CreateInstance(t);
plugin.SayHello();
}
}

The problem is, I don't want to have to know the name of the class I want to
load... I want to load the new module and get an instance of the class that
derives IPlugin. Is there a way to do so?

In C++ for the same purpose, I had a win32 dll with an extern function that
returned an instance of the contained class, so I loaded the dll, called the
function and I was ready to proceed. Is there something similar I can do
with .NET class libraries?

thanks
Nov 21 '05 #1
0 690

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

Similar topics

13
by: Mike | last post by:
Apparently there is now a way to hide html source code. How it done? For example see: See http://www.eteamz.com/banksblaze/
6
by: Graham Ashton | last post by:
Hi. I'm trying to edit C# code from within eclipse 2.1.1 but am getting nowhere. The Improve plug-in doesn't seem to install on such recent versions of eclipse; is there anything else out there...
3
by: Muhammad Aftab Alam | last post by:
Hello All is it possible to write plug-in for IIS with c#, if so what path should I follow to get to what I want. best regards Muhammad Aftab Alam
6
by: Gary James | last post by:
This may not be a direct C# question, but since I'll be using using C# for development, I thought I'd pose the question here. I'll soon be involved in the design of a new software product that...
1
by: TusharP | last post by:
Hi, Before asking my doubt, first I want to tell you about my application structure. I want to design a Client Desktop program, which has an MDI form. This MDi Form has one Horizontal Toolbar....
1
by: Koichi | last post by:
Hi, I'm now making a plug-in for a CG software. I embed Python in a plugin and it works. The problem is that it conflicts with other plugins that also embeds Python because it runs in the same...
1
by: DeveloperX | last post by:
I've knocked up a quick plug in project (actually it's 6 projects, but more on that in a moment). This project is referenced by a shared add in (used for Excel). The issue I have is that when...
1
by: JoderCoder | last post by:
I have an application (the code is C++, platform VS 2003) which has a plug in for outlook (i also have the msi installation file for the program). if i install the msi, outlook plug in will be...
4
by: -Lost | last post by:
How should one write a plug-in interface? I've tossed around several ideas but rudimentary ones at best. For example: Plug-In-A -Plug-In-Proxy -Application The plug-in simply hands off its...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.