Alex,
Yes, you want to take a look at the static CreateInstance method on the
Activator class.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"Alex K." <(E-Mail Removed)> wrote in message
news:8AB07788-228A-42B0-A763-(E-Mail Removed)...
> Hi all
>
> Is there any way to create an instance of a class using its type?
> I mean something like this:
>
> private void util() {
> object a = null;
>
> a = CreateObjectByType(typeof(MyClassA));
> }
>
> private object CreateObjectByType(Type classType) {
> ...
> }
>
> Thank you
>