Dynamic Binding to Winform Interface

G

Guest

I am trying to load an assembly dynamically in a windows form application and
bind to one of the interfaces contained in it.
I can successfully load the assembly into memory and create the object which
is a Form. But how do I bind to an interface the Form has implemented with
out making a project reference to the assembly that contains the interface? I
want the executable to interoperate with the Dynamic Loaded Form via
Interface only. I believe I am pushing the limits of .NET. But then again I
may just be ignorant. If anyone has any comments please share.
 
W

WineNCheese

Is your interface defined in a common place? You should be able to create
the form as you are now, and then do something like this (C#):

System.Windows.Forms.Form myForm = CreateMyForm(); // Your method to create
a form
IMyFormInterface myFormInterface = myCreatedForm as IMyFormInterface;

Or am I misunderstanding your question?

WNC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top