Programming For Other Programs? Plugins?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Donald Smith

    #1

    Programming For Other Programs? Plugins?

    Hello,

    Does anyone know how to code plugins, or code run off your own program
    that affects another program?

    Example: File1.exe sends the string "Test" to File2.exe (A Completely
    different program) and "Test" Appears in a textbox on File2.exe.

    Its kind of hard to explain, but I hope you know what I mean. I'm not asking
    for code on how to do that, I'm asking for the general idea on how to do it,
    but whatever you can contribute will be appreciated. Thanks. :)

    - Donald.


  • Jon Skeet [C# MVP]

    #2
    Re: Programming For Other Programs? Plugins?

    Donald Smith <StickOfDeodora nt@Cox.net> wrote:[color=blue]
    > Does anyone know how to code plugins, or code run off your own program
    > that affects another program?
    >
    > Example: File1.exe sends the string "Test" to File2.exe (A Completely
    > different program) and "Test" Appears in a textbox on File2.exe.
    >
    > Its kind of hard to explain, but I hope you know what I mean. I'm not asking
    > for code on how to do that, I'm asking for the general idea on how to do it,
    > but whatever you can contribute will be appreciated. Thanks. :)[/color]

    The way of writing plugins is usually that the "driver" program
    publishes an interface (as a DLL, usually) and the plugin is another
    DLL. The "driver" is then told (eg in a configuration file) the name of
    the plugin DLL, and it's loaded and used via interfaces.

    See http://www.pobox.com/~skeet/csharp/plugin.html for a complete
    example. The main point of the article is how to avoid problems with
    it, but it does give complete code.

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • Steve McLellan

      #3
      Re: Programming For Other Programs? Plugins?

      "Donald Smith" <StickOfDeodora nt@Cox.net> wrote in message
      news:VKRnc.4921 5$Fl5.23743@oke pread04...[color=blue]
      > Hello,
      >
      > Does anyone know how to code plugins, or code run off your own program
      > that affects another program?
      >
      > Example: File1.exe sends the string "Test" to File2.exe (A Completely
      > different program) and "Test" Appears in a textbox on File2.exe.
      >
      > Its kind of hard to explain, but I hope you know what I mean. I'm not[/color]
      asking[color=blue]
      > for code on how to do that, I'm asking for the general idea on how to do[/color]
      it,[color=blue]
      > but whatever you can contribute will be appreciated. Thanks. :)
      >
      > - Donald.[/color]

      We write Photoshop plugins and it works exactly as John says; a plugin is
      compiled as a DLL and must contain an entry point with a specified
      signature. Photoshop scans a given folder for any DLLs that have a valid
      entry point, and loads them when they're called. If you're doing it
      yourself, you need to be careful that you keep the interfaces identical
      between host and plugin. If all your plugins have a common interface, you
      can dynamically load them within the host app and call the interface
      function in the knowledge that the plugin knows what to do. Be aware of
      changes you make to shared data and any errors and exceptions that can get
      thrown - generally, having plugins throwing unexpected exceptions is a Bad
      Thing.

      Steve


      Comment

      Working...