Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cloning Objects
Message
De
15/01/2004 12:32:09
 
 
À
15/01/2004 11:22:28
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00867149
Message ID:
00867192
Vues:
15
Kevin,

If I understand your question correctly, you need to use Reflection, something like this:
string DLLName = "MyDLL";
string ClassName = "MyClass";
System.Reflection.Assembly oDLL;
object oClass;

// This "loads" the .DLL
oDLL = System.Reflection.Assembly.LoadFrom(DLLName);

// This creates the class instance
oClass = oDLL.CreateInstance(ClassName);
~~Bonnie


>Hi
>
>I have a derived class and I want the parent class to be ICloneable, the only problem is, how do I clone a derived class if I don't know what the type might be? With VFP (as an example) I could do:
>
>
>RETURN CREATEOBJECT(this.Class)
>
>
>Any ideas?
>Thanks
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform