thanks i will have a think about this
Peted
On Sat, 20 Jan 2007 11:16:51 -0600, "David Browne" <davidbaxterbrowne
no potted
(E-Mail Removed)> wrote:
>
>
>"Peted" wrote in message news:(E-Mail Removed)...
>> Hello
>>
>> Im writing a app that is designed to test and interrogate serial
>> devices.
>>
>> I can do the serial comunication ok
>>
>> My problem is i have a mdi parent form and i want the interface for
>> the serial device to appear as a child form, BUT each device has a
>> different interface with different options.
>>
>> I could in the project creat and compile a form for every new device i
>> come across or need to test, but that is very inflexiable.
>>
>> I want a way to creat the child form as a independant file stored on
>> HDD, and use a dialog box to load it and make it pop into my mdi app.
>> Is there a way to do this, then i could create and store a new child
>> form everytime i need to do so for new devices
>>
>> or how about is it possible to compile multiple forms into a lib of
>> some kind and call it. then i could just update the lib with new
>> interface forms
>>
>>
>
>Yes. You can compile additional types (forms in your case) into external
>assemblies. Load them at run-time, and dynamically load the types in them.
>Typically you either use a configuration setting to name the assembly and
>type to load, or use a custom attribute on the target type in the assembly.
>Or in your case you could just iterate the types in the loaded assembly and
>load the first Form you find.
>
>The key is to use .NET Reflection to load the assembly, find the right type
>in the assembly, and create an instance of the type.
>
>David