|
Listing 7-5 extracted from chapter Reflection, late binding, attributes
Listing 7-4< > Listing 7-6
This listing can be compiled with the command line: csc.exe /target:exe Example_7_5.cs Errors: 0 Warnings: 0
Example_7_5.cs
using System;
using System.Reflection;
class Program {
static void Main() {
object obj = AppDomain.CurrentDomain.CreateInstanceAndUnwrap(
"Foo.dll", "NMFoo.Calc");
// 'obj' is a reference toward an instance of NMFoo.Calc.
}
}
Copyright Patrick Smacchia 2006 2007
|