Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Ok, so I'm 'plugged in'. Now what? Need help with plugin/host communication.

Ok, so I'm 'plugged in'. Now what? Need help with plugin/host communication.

Scheduled Pinned Locked Moved C#
helptutorialcsharpcomquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Groetzner
    wrote on last edited by
    #1

    This plugin article[^] by Redth is a good place to start since it seems to do something like what I need. The only problem I have with it is doesn't clearly explain the ability to communicate information between the host & the plugin. Well at least to me anyway. :confused: So using that code as a base, perhaps someone can help clear this up for me. Lets add a button to the host. It's job will be to display "Hello world" in the text box located in plugin1. Lets also add a textbox to the host along with a button in plugin1. The button in plugin1 will display "hello world" in the newly created textbox on the host. If anyone can figure out how to communicate between the host & plugin using that example I would be most grateful. I'm about running out of hair!!!! :(( Any other assistance would also be welcomed or references to other documentation. I've searched & searched, but there's not much around that explains what I need to know. All I can find is documentation on creating a plugin and loading it on a host. Nothing exists (that I know of) to demonstrates communication between the two. THANKS!!!!!!!!!

    L 1 Reply Last reply
    0
    • P Paul Groetzner

      This plugin article[^] by Redth is a good place to start since it seems to do something like what I need. The only problem I have with it is doesn't clearly explain the ability to communicate information between the host & the plugin. Well at least to me anyway. :confused: So using that code as a base, perhaps someone can help clear this up for me. Lets add a button to the host. It's job will be to display "Hello world" in the text box located in plugin1. Lets also add a textbox to the host along with a button in plugin1. The button in plugin1 will display "hello world" in the newly created textbox on the host. If anyone can figure out how to communicate between the host & plugin using that example I would be most grateful. I'm about running out of hair!!!! :(( Any other assistance would also be welcomed or references to other documentation. I've searched & searched, but there's not much around that explains what I need to know. All I can find is documentation on creating a plugin and loading it on a host. Nothing exists (that I know of) to demonstrates communication between the two. THANKS!!!!!!!!!

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      I read your thread in the article. There isn't "one way" to do that. As in most designs, and a plug-in design is after all just another design, there are one or more interfaces that both the plug-in and the host know about and those interfaces are how you communicate from one to the other. Of course in .NET we also have delegates and events that can play a role in these interfaces. The bottom line is the developer must define these interfaces to satisfy the requirements of the project and in this case that means you.

      led mike

      P 1 Reply Last reply
      0
      • L led mike

        I read your thread in the article. There isn't "one way" to do that. As in most designs, and a plug-in design is after all just another design, there are one or more interfaces that both the plug-in and the host know about and those interfaces are how you communicate from one to the other. Of course in .NET we also have delegates and events that can play a role in these interfaces. The bottom line is the developer must define these interfaces to satisfy the requirements of the project and in this case that means you.

        led mike

        P Offline
        P Offline
        Paul Groetzner
        wrote on last edited by
        #3

        Thanks for your reply... I'm not particularly looking for 'one way' of doing it... Any way will be fine ;) I'm just looking more for direction as to how to go about doing it. The example I sited does achieve this somewhat by allowing 2 of the plugins to send feedback to the host which in turn launches a dialog box with the information sent to it. What I am needing assistance with is how to get it to post that information to the host's main form (say a text box) rather than an independent dialog box. Further on down in the message section someone had asked something similar. They wanted to put some data sent from the plugin to the status bar. Someone had posted a reply saying they were able to do it and how, but the answer seemed incomplete so I was unable to duplicate it. I guess my question really is this. I have 3 .cs files (pluginservices.cs which handles communication w/ host & plugin, my mainform.cs & mainform.designer.cs files) All of them belong to the same namespace (we'll call it 'host'). How can I access a button, textbox etc from my pluginservices.cs file. I thought that if I used a fully qualified name I would at least be able to access the object I want. Apparently this is not the case. Please keep in mind that I am still rather new to C# so if there are any concepts that I may not be aware about that would make this seem trivial please point it out. Thanks!

        L 1 Reply Last reply
        0
        • P Paul Groetzner

          Thanks for your reply... I'm not particularly looking for 'one way' of doing it... Any way will be fine ;) I'm just looking more for direction as to how to go about doing it. The example I sited does achieve this somewhat by allowing 2 of the plugins to send feedback to the host which in turn launches a dialog box with the information sent to it. What I am needing assistance with is how to get it to post that information to the host's main form (say a text box) rather than an independent dialog box. Further on down in the message section someone had asked something similar. They wanted to put some data sent from the plugin to the status bar. Someone had posted a reply saying they were able to do it and how, but the answer seemed incomplete so I was unable to duplicate it. I guess my question really is this. I have 3 .cs files (pluginservices.cs which handles communication w/ host & plugin, my mainform.cs & mainform.designer.cs files) All of them belong to the same namespace (we'll call it 'host'). How can I access a button, textbox etc from my pluginservices.cs file. I thought that if I used a fully qualified name I would at least be able to access the object I want. Apparently this is not the case. Please keep in mind that I am still rather new to C# so if there are any concepts that I may not be aware about that would make this seem trivial please point it out. Thanks!

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          Paul Groetzner wrote:

          The example I sited does achieve this somewhat

          Perhaps the plug-in design in the article is not suited to your requirements.

          Paul Groetzner wrote:

          What I am needing assistance with is how to get it to post that information to the host's main form

          Well if my first post didn't help you understand things more clearly I don't think I will be able to help. In my experience text messaging is not a great format for learning about design concepts, in contrast with a live session using white boards etc. As a closing comment I would say you might be having a forest/tree problem. If you focus on trying to see "how to get object X to access object Y" rather than focusing on learning and understanding design principles and concepts you may always have this problem.

          led mike

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups