Invoke Assembly Interface from Another Assembly.

  • Thread starter Thread starter Guest
  • Start date Start date
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,
 
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.
 
Back
Top