| Author: Hari 07 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
Hi,
Assembly.GetExecutingAssembly().GetType( "[YOUR PROJECT NAME]." & objectName) The above line searches in the assembly manifest for the type specfied by objectName and returns that type.
returnObj = Activator.CreateInstance(Type, args
Teh above line calls the constructor of the specfied type by passing the arugments if required for the type and returns an instance of the type.
|
| Author: ABitSmart 07 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
The above code is using Reflection to dynamically create a type based on the given object name. Using reflection, given a type it creates an instance object. The above code extracts the type information from the assembly metadata and then creates and instance of the object/
Kind regards, ABitSmart DNS Web-master, DNS MVM My blog Thoughts.exe
|