1. ATK Gimmy Susan
  2. PowerBuilder
  3. Sunday, 22 March 2020 09:30 AM UTC
Good morning

I have the following need.
 
I'm running two apps written in Powerbuilder (app1 and app2).
How does app1 tell App2 to run an event.
 
Thank you in advance
 
 
Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 23 March 2020 19:24 PM UTC
  2. PowerBuilder
  3. # Permalink

You could use Winsock. App2 would listen on a port and App1 would send the message.

https://www.topwizprogramming.com/freecode_winsock.html

 

Comment
  1. ATK Gimmy Susan
  2. Tuesday, 24 March 2020 16:54 PM UTC
Interesting, but why pbm_custom01 and not pbm_cusatom02 or anything?
  1. Helpful
  1. Roland Smith
  2. Tuesday, 24 March 2020 17:02 PM UTC
The third argument is the pbm_custom## number. You can use whichever one you want. The second argument is the handle of the window or userobject that contains the event. The first argument is the port.



iul_socket = gn_ws.of_Listen(lui_port, Handle(Parent), 1)

  1. Helpful
  1. ATK Gimmy Susan
  2. Wednesday, 25 March 2020 08:01 AM UTC
great magic !!!
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Monday, 23 March 2020 15:31 PM UTC
  2. PowerBuilder
  3. # 1

Some other options
1) Using a database for messaging:  App1 writes a message to the DB, App2 "listens" by regularly reading from the DB.
2) Using messaging software like IBM MQ

3) PTP software - years ago I did a project where we had to send messages to vehicles in a fleet from dispatching software.  We used software called DART.  When the vehicles would log in, they would register their ip in the database.  The dispatcher app would determine which vehicle to send the message to, look up their ip in the db, and then send the message.  Not sure what other PTP software vendors are out there, but it's another option.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Sunday, 22 March 2020 22:36 PM UTC
  2. PowerBuilder
  3. # 2

Hi Gimmy;

  Here is a working example of using both the PB Send() command and/or the SendMessageW API that achieves what your asking ...

http://chrispollach.blogspot.com/2019/11/sendmsg.html

HTH

Regards ... Chris

Comment
  1. ATK Gimmy Susan
  2. Monday, 23 March 2020 11:15 AM UTC
Hi chris

Thanks for the answer, i looked your code.



i have a doubt:

- send statement has 4 parameters: Send ( iul_handle , lul_msg_no , iul_handle , Handle ( THIS ) ). The manual says that the last can be a string.

- the event it receives has only 2 parameters. what is the content of these 2 parameters?

- Is possible to send a string ?





  1. Helpful
  1. mike S
  2. Monday, 23 March 2020 14:40 PM UTC


you can store strings or whatever n the registry or a temp file, and have app2 read it

  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 23 March 2020 20:12 PM UTC
Hi Gimmy;

Like Mike says ... or better yet - how about the ClipBoard?

Also, that is what the "SendString" API is for too as well. ;-)

Regards ... Chris
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Sunday, 22 March 2020 15:22 PM UTC
  2. PowerBuilder
  3. # 3

this describes the technique.  i believe this is roland and chris from the old sap forum.

https://answers.sap.com/questions/12296328/triggering-a-user-event-in-pb-window-form-another-.html

 

 

 

Comment
  1. Roland Smith
  2. Monday, 23 March 2020 00:39 AM UTC
Yes, that was my reply that Chris replied to.
  1. Helpful
  1. ATK Gimmy Susan
  2. Tuesday, 24 March 2020 08:16 AM UTC
Thank you for the link.

The receiving program goes into error and crash to the line: 'ls_data - String(lparam, 'address')'



Some ideas ?





  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.