That is the closest thing to what you wrote that makes sense to me. It seems
like you either want to make an object from a class in the assembly and run a
method on it in a new thread or you want to extract a class and run a static
method on it in a new thread. The last post was the first.
This is the second incase thats what your after. I'm havent tested it but
its there of there abouts. You might need to have a little play to get the
GetMethod to find the right method etc.
Assembly ass = Assembly.LoadFrom("c:\\myassembly\file.dll");
Type mytype = ass.GetType("MyAssembly.MyType");
MethodInfo method = mytype.GetMethod("StaticMethodName", BindingFlags.Static
| BindingFlags.Public);
Thread t = new Thread(new ThreadStart(delegate() {
method.Invoke(null, new object[] { });
}));
t.Start();
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Ciaran O''Donnell" wrote:
> Something along the lines of:
>
> interface IBaseType
> {
> public void GetString();
> }
>
>
> void RunThread()
> {
>
> IBaseType obj = Activator.CreateInstance("c:\\myassembly\file.dll",
> "MyAssembly.MyType");
> Thread t = new Thread(new ThreadStart(obj.GetString()));
> t.Start();
> }
>
>
> --
> Ciaran O''Donnell
> http://wannabedeveloper.spaces.live.com
>
>
> "Ahmad" wrote:
>
> > Hi,
> >
> > Is it possible to do something like the the following:
> >
> > IBaseClass objClass = new LoadClassFromDLL( "Module.DLL");
> > ThreadStart objThreadStart= new
> > (objClass.GetFunctionFromName("GetString"))
> >
> > Thread objThread = new Thread (objThreadStart)
> > objThread.Start();
> >
> > Bearing in mind the function 'GetFunctionFromName' doesn't exist and I have
> > no idea how to implement it.
> >
> > Thanks in Advance.
> >
> > Regards,
> >
> > Ahmad
> >