Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

send events using vb.net code???

If you have a question or need help, this is the place to be.
tommylam
Posts: 16
Joined: Fri Aug 01, 2014 7:59 am

send events using vb.net code???

Post by tommylam »

I use vb.net language. I want to send the event by vb.net code.

thanks!
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: send events using vb.net code???

Post by Pako »

I do not know for sure, but maybe the following topic will help you:
COM Integration with other apps that require a type library?
Please tell us even if you find a suitable solution.

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: send events using vb.net code???

Post by krambriw »

Or, more generic, use a message broker like MQTT (mosquitto) and you can publish/subscribe events from many users on different machines and various environments (Linux, Windows, Mac, iOS, Android, Java...).

I think you can find sample vb.Net implementations using mosquitto if you google a bit. I have written a MQTT Client for EG that can both subscribe and publish events to the broker.

Best regards, Walter
tommylam
Posts: 16
Joined: Fri Aug 01, 2014 7:59 am

Re: send events using vb.net code???

Post by tommylam »

Does not work on "Win 8.1 64 bit"
Please help
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: send events using vb.net code???

Post by krambriw »

What is not working?

I could only try in W7 64bit and there the little test application works fine. Could it be related user rights?

From the log

Code: Select all

18:09:29   Main.C# Event u"C# Payload"
18:09:48   Main.C# Event u"C# Payload"
tommylam
Posts: 16
Joined: Fri Aug 01, 2014 7:59 am

Re: send events using vb.net code???

Post by tommylam »

I am using Win 8.1 64bit
phenomenon hangs send event

Please help
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: send events using vb.net code???

Post by Pako »

tommylam wrote:Please help
It is like calling a man who is drowning.
In this case there is nothing to add.

But I thought, that you are asking for help in solving a problem.
Why are you so close-mouthed?
Two ways of solution have been presented to you.
I would expect that you write why this solution is not suitable for you,
or what you've done and from what point it does not work as expected.

In other words - you should try to provide as much information
so that the man who wants to help, had the job as easy as possible.

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: send events using vb.net code???

Post by krambriw »

Very well spoken Pako,

Best regards Walter
tommylam
Posts: 16
Joined: Fri Aug 01, 2014 7:59 am

Re: send events using vb.net code???

Post by tommylam »

I use this code

Code: Select all

  private void TriggerEvent(string EventName, string Payload)
    {
      Object[] Params;
      Type EventGhost = Type.GetTypeFromProgID("EventGhost");
      object myObject = Activator.CreateInstance(EventGhost);
      Params = new Object[] { EventName, Payload };
      EventGhost.InvokeMember("TriggerEvent", BindingFlags.InvokeMethod, null,
      myObject, Params);
    }
But it does not work on win 8.1 64 bit
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: send events using vb.net code???

Post by krambriw »

The code was posted back in 2009 some 7 months before Windows 7 was released. Obviously the code is working in some Windows versions so you might have to look for VB compatibility issues related to Windows 8.

Anyway, did you also try to run the executable that is inside the zip???

Did you try and verify the functionality in another Windows version?

Code: Select all

EGTest.zip\EGTest\EGTest\bin\EGTest.exe
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: send events using vb.net code???

Post by Pako »

tommylam wrote:But it does not work on win 8.1 64 bit
#1) So what do you actually want? You asked VisualBasic solution, but this is C#.
#2) On Windows 8 Pro (64 bit) it works. And even both options (VisualBasic and C#).

Pako
tommylam
Posts: 16
Joined: Fri Aug 01, 2014 7:59 am

Re: send events using vb.net code???

Post by tommylam »

I copied the code at link
viewtopic.php?f=2&t=461


Here is the code I am using

Code: Select all

 Public Sub TriggerEvent(ByVal EventName As String, ByVal Payload As String)
        Dim Params As [Object]()
        Dim EventGhost As Type = Type.GetTypeFromProgID("EventGhost")
        Dim myObject As Object = Activator.CreateInstance(EventGhost)
        Params = New [Object]() {EventName, Payload}
        EventGhost.InvokeMember("TriggerEvent", Reflection.BindingFlags.InvokeMethod, Nothing, myObject, Params)
    End Sub
I add code to the form load event

Code: Select all

TriggerEvent("test", "event")
it does not work on win 8.1 64bit
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: send events using vb.net code???

Post by Pako »

Please try the attached two programs.
One is created using vb, the second using C#.

Pako
Attachments
Test.zip
(11.5 KiB) Downloaded 233 times
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: send events using vb.net code???

Post by Pako »

Please anyone of you is the user of operating system Win 8.1 64 bit?
If so, can you please try the programs provided in the previous post?
Of course, I suppose then tell us the result.
Thanks , Pako.
tommylam
Posts: 16
Joined: Fri Aug 01, 2014 7:59 am

Re: send events using vb.net code???

Post by tommylam »

Sorry. me busy jobs.
two of your applications work well on "win 8.1 64 bit".
Please give code applications

thanks!
Post Reply