Home All Groups Group Topic Archive Search About

Instantiating classes at runtime

Author
22 Mar 2006 11:26 AM
Mr. Morad Jamal
Tell me guys how to instantiate a class at runtime given the assembly DLL
file and the class name ?
Thanx in advance ..

Author
22 Mar 2006 11:51 AM
Herfried K. Wagner [MVP]
"Mr. Morad Jamal" <MrMoradJa***@discussions.microsoft.com> schrieb:
> Tell me guys how to instantiate a class at runtime given the assembly DLL
> file and the class name ?

'Assembly.LoadFrom' + 'Activator.CreateInstance'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
22 Mar 2006 12:03 PM
Mr. Morad Jamal
Thanx Herfried, but can you explain your statement more ?? I'd appreciate it..

Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "Mr. Morad Jamal" <MrMoradJa***@discussions.microsoft.com> schrieb:
> > Tell me guys how to instantiate a class at runtime given the assembly DLL
> > file and the class name ?
>
> 'Assembly.LoadFrom' + 'Activator.CreateInstance'.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
>
Author
22 Mar 2006 3:18 PM
Herfried K. Wagner [MVP]
"Mr. Morad Jamal" <MrMoradJa***@discussions.microsoft.com> schrieb:
> Thanx Herfried, but can you explain your statement more ?? I'd appreciate
> it..

\\\
Dim o As Object = _
    Activator.CreateInstance(<assembly name>, <type name>)
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
22 Mar 2006 10:36 PM
Mr. Morad Jamal
thank you so much fir your efforts dude ...

Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "Mr. Morad Jamal" <MrMoradJa***@discussions.microsoft.com> schrieb:
> > Thanx Herfried, but can you explain your statement more ?? I'd appreciate
> > it..
>
> \\\
> Dim o As Object = _
>     Activator.CreateInstance(<assembly name>, <type name>)
> ///
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
>