Results 1 to 5 of 5

Thread: Plugin style app question

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    Plugin style app question

    i am making a plugin style app..but i am facing a dilema...i have the plugins which will implement an interface(or maybe an abstract class i dont really know) so the mother class will know that every plugin have that given functions...but i want interaction between the plugins and the main class(Form)..for example, i want that my plugins give the url to the mother form and that form will do the download and in the end say to the plugin that the download has finished..but how the plugin will know the which function to call? will i have to make a interface that the form will have to implement too, so the plugin knows what are the form's functions?

    ..
    if i wasnt explicit enough say it..i am almost asleep
    \m/\m/

  2. #2

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i mean, using Cander's way of invoking methods thru reflection i must use interfaces, is there any way of doin that without interfaces? lol

    or do u think that with interfaces/abstract class it would be better?
    \m/\m/

  3. #3

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i also realised that by using cander's way i cant use abstract classes instead of interfaces as an abstract class can't be instantiated ....
    \m/\m/

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    It's a back/forth interaction. Have your plugin interface have some kind of init function:
    Code:
    interface IPlugin
    {
    // ...
      public bool Init(IPluginHost);
    }
    where IPluginHost is an interface that provides methods with which the plugins can request info from your app. It could also expose events if interfaces can do that.
    IPluginHost would be implemented by some of your classes (e.g. the main form) and a reference to this class be passed to every plugin as an IPluginHost.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Small sample project.
    You have to copy the dll from the Plugin project to the Pluggable's plugin directory every time you recompile.
    Attached Files Attached Files
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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