Re: dynamic DLL loading



Thanks Octavio.


"Octavio Hernandez" <dotnet@xxxxxxxxxxxx> wrote in message
news:eD8p$rxnFHA.2540@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Use a.GetType("YourClass")
>
> Regards - Octavio
>
> "Pohihihi" <pohihihi@xxxxxxxxxxx> escribió en el mensaje
> news:%238$3bxqnFHA.572@xxxxxxxxxxxxxxxxxxxxxxx
>>I want to enable a button for some funtionality in my main application by
>>checking if a perticular assembly is installed or not. I have following
>>code --
>>
>> Assembly a = Assembly.LoadFrom("DLLHello.dll");
>> Type[] myTypes = a.GetTypes();
>> BindingFlags flags = (BindingFlags.NonPublic | BindingFlags.Public |
>> BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);
>> foreach( Type t in myTypes )
>> {
>> ConstructorInfo[] ci = t.GetConstructors();
>> object obj = Activator.CreateInstance(t);
>> foreach(ConstructorInfo c in ci)
>> {
>> c.Invoke(obj,null);
>> }
>> }
>>
>> Very much from MSDN but I am stuck after first foreach loop.
>>
>> My problem is how to get instance of my class and all the methods inside
>> it, like I can get by ref at design time !!
>>
>> Thanks
>> --
>> Po
>>
>>
>
>


.