Invoke Assembly Interface from Another Assembly.

G

Guest

Hello,

I have a DLL Project with some user-controls which implements a Interface
(Exit), this is used to warn the user if any changes done when trying to
close the user-control.

the interface is defined in the DLL project it self, but

the when the 'Cancel' buton is pressed from the user-controls of DLL, I
raise a event to mother project which handles the closing of the user
control,

How can type cast the Interface here?

// MDI FORM.
// tempcontrol is a user control of DLL project.
//iFormExit is defined in DLL project

Internal void OnCancelUserControl(object sender,
CancelDevicePropertyPageEventArgs e)
{
UserControl tempControl = (UserControl)sender;
bool result = (iFormExit)tempControl).IsExitSave();
}

how can I make this work?

Thanks,
 
R

Roman Wagner

Hello,

looks like the interface is in the wrong project.

Make a new project for your interface and add a reference to from both
your main project and your control project.
After that you can implement the interface from your controls project
and use it from your main project.
 

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