Re: Thanks... but...
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 9 Aug 2006 11:52:16 -0400
Laurent,
You should still do what I recommended.
What you need to do is create an interface that the main form will
implement which exposes the functionality. Then, you pass that interface
definition to your plug in. Of course, the interface is defined in the
assembly that is referenced by the plug in and the main application.
Either that, or pass the type System.Windows.Forms.Form to your plug in,
instead of the typed version.
It's actually a really bad idea to allow plug ins free reign like this.
You should have a constrained set of functionality that the form implements
and exposes through the interface definition and then pass that to your plug
in.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Laurent Navarro" <yop@xxxxxxx> wrote in message
news:unikUn8uGHA.1216@xxxxxxxxxxxxxxxxxxxxxxx
Thanks Nicholas and Andy for your quick answer, I understand that I
must create an assembly that both the plugins and the applications will
reference when compiling.
I already created an abstract PlugIn class which is the base class for
all of my plugin (it is not only an interface as I have some functions in
it). Because I want my plugin to interact directly with the GUI of my
applications, I have a reference to my main form in the PlugIn class.
Of course, when I try to compile my abstract PlugIn class into an
assembly, it doesn't want because he can't find the reference to my main
form.
I'm begining in assemblies, what should I do ?
Thanks !
"Laurent Navarro" <yop@xxxxxxx> a écrit dans le message de news:
O91u6z7uGHA.4624@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
I created a software some times ago, which uses some plugins to work
(which I coded also). I had problems to load those plugins as they used
some classes and functions which were compiled into the main executable.
So I had to compile them by hand, adding the main executable as reference
to the csc.exe command line. It worked.
Now, I would like to create another application which would use the
same plugin. If I link the old ones with my new software, I have an error
saying that the DLL could not be loaded. I use the
Activator.GetInstance() function...
My question is: is there a way to share my plugins between my
applications without having to compile them each time with a difference
reference to the main executable ?
Thank you for your help !
Laurent
.
- References:
- Sharing plugins between two C# applications
- From: Laurent Navarro
- Thanks... but...
- From: Laurent Navarro
- Sharing plugins between two C# applications
- Prev by Date: Re: HELP!!! DOGS IN CHINA
- Next by Date: Re: newbie help for winform combo box needed
- Previous by thread: Re: Thanks... but...
- Next by thread: Thanks...
- Index(es):
Relevant Pages
|