Hi Bob, May be it is a stupid question, but I am new to .Net and I am wondering if you can please help me. How can you dynamically load a component in c#. Imean I understand that you can do the new and can have an instance of a component but for that it is also required to use "using component class".
What I want to achieve is to read teh name of component from some out side file and then can instantiate it.
Regards, Rawal.
Stuart Carnie
2004-07-20, 3:57 am
Do you want to instanciate a managed class or a set of exported functions from a DLL?
Cheers,
Stu rawal <rawal.19imdq@mail.codecomments.com> wrote in message news:<851526108ea4250abc8be46cf9a31a9c@news.thenewsgroups.com>... > Hi Bob, > May be it is a stupid question, but I am new to .Net and I am wondering > if you can please help me. > How can you dynamically load a component in c#. Imean I understand > that you can do the new and can have an instance of a component but for > that it is also required to use "using component class". > > What I want to achieve is to read teh name of component from some out > side file and then can instantiate it. > > Regards, > Rawal.
Dincer Ozturan
2004-07-20, 8:58 am
Hi,
You can dynamically load a managed component (.dll) by using the components under System.Reflection namespace, like "System.Reflection.Assembly". You can load the dll by using System.Reflection.Assembly.Load(..) System.Reflection.Assembly.LoadFile(string FileName) System.Reflection.Assembly.LoadFrom(string FilePath) methods. If you do not have managed dll, you have to wrap it and load the wrapper. After loading you can use the loaded component by using the other classes under same namespace(Sys.Ref).
Regards, Dincer
rawal <rawal.19imdq@mail.codecomments.com> wrote in message news:<851526108ea4250abc8be46cf9a31a9c@news.thenewsgroups.com>... > Hi Bob, > May be it is a stupid question, but I am new to .Net and I am wondering > if you can please help me. > How can you dynamically load a component in c#. Imean I understand > that you can do the new and can have an instance of a component but for > that it is also required to use "using component class". > > What I want to achieve is to read teh name of component from some out > side file and then can instantiate it. > > Regards, > Rawal.