Results 1 to 3 of 3

Thread: Custom Plugins for an app?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Custom Plugins for an app?

    Hello guys,

    I am trying to figure out an easy way to add custom plugins for the app for additional features, without people having to download a whole new update each time.


    either by DLL? or what?

    Any ideas would be great.

    i guess the way i'd want it to work is,

    the program will auto detect the plugin file. Then, add's a specific value to either a button array, or add's a picture, etc.

    Once that button is clicked, it will open a new form designed the way i want it. from within the plugin itself.

    So its a module.


    What would be the easiest way to do this?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Custom Plugins for an app?

    This is an oft-discussed topic concerning the use of interfaces. You would create a DLL that defines an interface for any class that wants to be a plugin for your app, e.g.
    vb.net Code:
    1. Public Interface IPlugin
    2.     Sub DoStuff()
    3. End Interface
    You would obviously add whatever members your plugins needed for the app to interact with them. Anyone who now wants to create a plugin for your app would download the DLL containing the interface and create their own DLL project that references it and defines a class that implements the interface.

    Your app will then most likely have a folder specifically for plugins. At run time your app will use reflection to load each DLL in that folder and query it for types that implement your IPlugin interface. It can then interact with those classes to through the members of that interface to provide extended functionality.

    If you search the web for something like plugin architecture .net then you'll likely find various blogs and the like that will go into more detail.

    That's the way it has historically been done and can still be done if you desire. It's also worth noting that, from version 3.5, the .NET Framework includes an architecture for creating extensible applications. For more info on that:

    http://msdn.microsoft.com/en-us/library/bb788290.aspx
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Custom Plugins for an app?

    thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width