Works great. Thanks muchhhhhhh!!!!!
bob
>Hi Bob,
>
>Here's a little blurb I frequently use to show how to do this:
>
>Code to instantiate a class with reflection:
>
>
>string DLLName = "MyDLL.dll";
>string ClassName = "MyDll.MyClass";
>System.Reflection.Assembly oDLL;
>object oClass;
>
>// This "loads" the .DLL
>oDLL = System.Reflection.Assembly.LoadFrom(DLLName);
>
>// This creates the class instance
>oClass = oDLL.CreateInstance(ClassName, true);
>
>And if you need to pass parameters
>
>// Create an object array to pass your parameters
>object [] args = new object[1];
>args[0] = MyKey;
>oForm = (Form)oDLL.CreateInstance(classname, true, System.Reflection.BindingFlags.CreateInstance, null, args, null, null);
>
>
>The only thing you'll need to change in the above sample, is that the DLLName will also include the path to the DLL. That should be all you need to do. (error trapping is recommended of course <g>)
>
>~~Bonnie
>
>
>
>>Can anyone point me in the right direction (sample code, etc.) to do the following:
>>
>>I need to invoke a class at runtime (most likely via reflection) contained in a DLL that I don't know until runtime its location. It will not be located in the start-in folder or program folder.
>>
>>Thanks!!
>>
>>Bob