Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cloning Objects
Message
From
15/01/2004 12:32:09
 
 
To
15/01/2004 11:22:28
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00867149
Message ID:
00867192
Views:
17
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform