I have written a plugin system that uses an interface and for any plugins that meet this contract are loaded at runtime into the main system.
The plugin effectively returns a TabPage that is slotted into the main app, and is controlled fromwithin the plugin dll.
If an error occurs within the plugin, the standard Windows error message shows. What I want to do it create an event that returns the error message so I can display it in the area I have reserved for text.
Do I need to keep a track of all attached plugin/interface instances to be able to set up an event to monitor each one?
At present, my system loops through the dll’s within the app folder and those that meet the interface contract are loaded up, the actual instance of the interface is discarded each time as control is then handed over to the dll via button events that are loaded with the TabPage and handled within the plugin.
I hope this all makes sense.
You don’t need to keep a reference to the plugin class, just add a delegate to the event when you start it up, after that you don’t need the reference anymore.