dynamically creating an instance of a class

  • Thread starter Thread starter James Zhuo
  • Start date Start date
J

James Zhuo

Hi all

I am building a plugin application. My application is
required to search for new pluggins within a predefined
directory and invoke it by creating a new instance of what
ever the pluggin is and bring up the main form associated
with that particular plugin. How would I do that?

I have checked up something call appdomain, not totally
sure how to use it. Is there any resources that i may be
able to look up on? or am i on the right track at all?
There are all these methods called CreateInstance,
CreateInstanceAndUnwrap, CreateInstanceFromAndUnwrap,
what's the difference between all these?

thanx

James
 
* "James Zhuo said:
I am building a plugin application. My application is
required to search for new pluggins within a predefined
directory and invoke it by creating a new instance of what
ever the pluggin is and bring up the main form associated
with that particular plugin. How would I do that?

I have checked up something call appdomain, not totally
sure how to use it. Is there any resources that i may be
able to look up on? or am i on the right track at all?
There are all these methods called CreateInstance,
CreateInstanceAndUnwrap, CreateInstanceFromAndUnwrap,
what's the difference between all these?

Have a look at this sample:

<http://www.codeproject.com/csharp/livecodedotnet.asp>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Back
Top