|
-
Jan 12th, 2024, 10:25 PM
#1
[RESOLVED] Plug-ins… can I add custom editors along with plug-in DLLs?
I’m planning a new application using plugins. All of the DLLs are easy to create, but the GUI needs an additional editor for 2 of the DLLs. Is it possible to import a dialog form dynamically?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 12th, 2024, 11:01 PM
#2
Re: Plug-ins… can I add custom editors along with plug-in DLLs?
Not sure what the question is. If the plugins are DLLs, they can have anything that a program can have, so dialogs are certainly possible. I have a plugin system that looks for certain interfaces, and creates instances of any object that implements one of those interfaces. The main interfaces have a OnDrop method, which can do whatever I want, but usually opens a form.
My usual boring signature: Nothing
 
-
Jan 12th, 2024, 11:05 PM
#3
Re: Plug-ins… can I add custom editors along with plug-in DLLs?
I'm not sure how to include a form with a class library DLL. I've never really used compiled DLLs much. Could you post an example of the (simplified) interface and how you open the form?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 12th, 2024, 11:21 PM
#4
Re: Plug-ins… can I add custom editors along with plug-in DLLs?
I’m nearly sure I can formulate something based on your answer. I was originally thinking of a function that returns a dialog, but now I see that’s not the best way to tackle this. A function that returns what I want to retrieve from the dialog will be perfect…
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jan 13th, 2024, 09:27 AM
#5
Re: [RESOLVED] Plug-ins… can I add custom editors along with plug-in DLLs?
Yes, that's what I'm doing, too. My plugins all have an object that implements an interface. There are actually about half a dozen different interfaces to choose from, but most don't have anything to do with forms. The object that implements the interface does all the work. That's all the program interacts with. If that object wants to show a form, then it does, but it is that plugin object that deals with whatever comes out of the form. The main application only deals with the plugin object, not the form.
I also have an Event Raiser class, which is convenient for communication. The interface has an Initialize method. When the main program finds a plugin, it creates an instance of the object that implements the plugin interface and calls it's Initialize method while passing it the single instance of the Event Raiser class. The plugin object then holds that reference.
By doing that, the main program can communicate to the plugins, and vice versa, to some extent. Every object can subscribe to events raised by an object that it knows about, and everything knows about the Event Raiser class. So, when the main program wants to tell all the plugins to do something like refresh themselves, it has the Event Raiser to raise a refresh event. All the plugins can handle that event and know to refresh. Of course, you can't force a plugin to handle an event, so there could be bad actors. That means that you can always raise events, you just can't be dependent on everybody properly handling those events.
My usual boring signature: Nothing
 
-
Jan 15th, 2024, 05:19 AM
#6
Re: [RESOLVED] Plug-ins… can I add custom editors along with plug-in DLLs?
 Originally Posted by Shaggy Hiker
Yes, that's what I'm doing, too. My plugins all have an object that implements an interface. There are actually about half a dozen different interfaces to choose from, but most don't have anything to do with forms. The object that implements the interface does all the work. That's all the program interacts with. If that object wants to show a form, then it does, but it is that plugin object that deals with whatever comes out of the form. The main application only deals with the plugin object, not the form.
I also have an Event Raiser class, which is convenient for communication. The interface has an Initialize method. When the main program finds a plugin, it creates an instance of the object that implements the plugin interface and calls it's Initialize method while passing it the single instance of the Event Raiser class. The plugin object then holds that reference.
By doing that, the main program can communicate to the plugins, and vice versa, to some extent. Every object can subscribe to events raised by an object that it knows about, and everything knows about the Event Raiser class. So, when the main program wants to tell all the plugins to do something like refresh themselves, it has the Event Raiser to raise a refresh event. All the plugins can handle that event and know to refresh. Of course, you can't force a plugin to handle an event, so there could be bad actors. That means that you can always raise events, you just can't be dependent on everybody properly handling those events.
- rating pending… site won’t let me rate yet
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|