# How to report host from non visual plugin progress?

**URL:** https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749
**Category:** Hydra
**Created:** [February 23, 2015, 7:48am UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749 "2015-02-23T07:48:59Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![carstenbarthol](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/ba8739/32.png) [@carstenbarthol](https://talk.remobjects.com/u/carstenbarthol)
#### Post date: [February 23, 2015, 7:48am UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/1 "2015-02-23T07:48:59Z")

</div>

Hi,  
i want to move functionality into non visual plugin.  
The host should load plugin, start plugin. Then the plugin does its job.  
When it is finished, the plugin should contact the host, so that the plugin can be unloaded.

How can i archive that (.net)

KR  
CBL

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [February 23, 2015, 10:46am UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/2 "2015-02-23T10:46:46Z")

</div>

You can find this [article](http://wiki.remobjects.com/wiki/Passing_interfaces_between_Host_and_Plugins%23Synchronizing_in_NonVisualPlugins) useful

---

<div class="post-metadata">

### Author: ![carstenbarthol](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/ba8739/32.png) [@carstenbarthol](https://talk.remobjects.com/u/carstenbarthol)
#### Post date: [February 25, 2015, 2:55pm UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/3 "2015-02-25T14:55:38Z")

</div>

Thanks for the hint.

However i have difficulities bringing the pieces togehther.

Can you please provide a small example, where host and non visual plugin are written in C#.

Thanks in adavnce,

KR

CBL

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [February 26, 2015, 3:43pm UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/4 "2015-02-26T15:43:06Z")

</div>

Hello

Hydra ships with a .NET host sample (just ignore the projects that will fail to open, like Oxygene ones). The sample can be found in the folder

```
 c:\Users\Public\Documents\RemObjects Samples\Hydra for NET\Mixed Mode

```

The project **ManagedCSharpHost.** is a simple host application that supports both visual and non-visual plugins. Also Hydra provides a template for non-visual plugins. Take a look at this article, it describes how to create and use non-visual plugins: [http://wiki.remobjects.com/wiki/.NET\_Non-Visual\_Plugins](http://wiki.remobjects.com/wiki/.NET_Non-Visual_Plugins)

Hope that helps

---

<div class="post-metadata">

### Author: ![carstenbarthol](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/ba8739/32.png) [@carstenbarthol](https://talk.remobjects.com/u/carstenbarthol)
#### Post date: [February 27, 2015, 4:10pm UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/5 "2015-02-27T16:10:27Z")

</div>

Sorry, but it seems that you misunderstood me  
The request for a working example was for synchronizing non visual plugin with hist, all in C#

Thnaks in advance.

KR  
CBL

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [March 2, 2015, 10:44am UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/6 "2015-03-02T10:44:36Z")

</div>

You’d need to define a custom plugin interface:

Add a new Class Library project to your solution.

Define there plugin interface like

```
public interface IPluginModule
{
    void Execute();
    event EventHandler Completed;
}

```

Reference the newly added project from the plugin project and implement the interface by the non-visual plugin.

Reference the assembly containing the interface definition from the host application

Once the plugin is loaded check its type and start it:

```
(this.fCurrentPlugin as IPluginModule).Completed += (s, ea) => { MessageBox.Show("Done!"); };
(this.fCurrentPlugin as IPluginModule).Execute();

```

The plugin will be able to send a signal to the host via raising an event.

---

<div class="post-metadata">

### Author: ![carstenbarthol](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/ba8739/32.png) [@carstenbarthol](https://talk.remobjects.com/u/carstenbarthol)
#### Post date: [March 2, 2015, 1:46pm UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/7 "2015-03-02T13:46:36Z")

</div>

Hi,  
thanks so far. I created a deno project, but all i get is debugger errir, not knowing where the problem is.

Could you please provide a complilable project for your last reply (Void Execute and Eventhandler)

KR

CBL

---

<div class="post-metadata">

### Author: ![carstenbarthol](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/ba8739/32.png) [@carstenbarthol](https://talk.remobjects.com/u/carstenbarthol)
#### Post date: [March 4, 2015, 10:43am UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/8 "2015-03-04T10:43:19Z")

</div>

Hi,  
where can i upload my example project ?

KR  
CBL

---

<div class="post-metadata">

### Author: ![EvgenyK](https://talk.remobjects.com/user_avatar/talk.remobjects.com/evgenyk/32/16_2.png) [@EvgenyK](https://talk.remobjects.com/u/EvgenyK)
#### Post date: [March 4, 2015, 10:45am UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/9 "2015-03-04T10:45:48Z")

</div>

You can attach it here or send directly to support@

---

<div class="post-metadata">

### Author: ![carstenbarthol](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/c/ba8739/32.png) [@carstenbarthol](https://talk.remobjects.com/u/carstenbarthol)
#### Post date: [March 5, 2015, 2:52pm UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/10 "2015-03-05T14:52:25Z")

</div>

Hi,

thanks, that did the trick.  
Now it works as expected.

KR

CBL

---

<div class="post-metadata">

### Author: ![antonk](https://talk.remobjects.com/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@antonk](https://talk.remobjects.com/u/antonk)
#### Post date: [October 20, 2017, 5:50pm UTC](https://talk.remobjects.com/t/how-to-report-host-from-non-visual-plugin-progress/5749/11 "2017-10-20T17:50:49Z")

</div>

A post was split to a new topic: [Raising cross-patform events (.NET plugin vs Delphi host)](https://talk.remobjects.com/t/raising-cross-patform-events-net-plugin-vs-delphi-host/14523)
