1. Samuel Sanchez Avila
  2. PowerBuilder
  3. Wednesday, 15 January 2020 16:45 PM UTC

Hello, im trying to pass data throw 2 PB Apps already ejecuting. I find DDE functions and im testing this:

 

PB APP 1 - APP SERVER

      StartServerDDE (this,"MyPBApp","System")

PB APP 2 - APP CLIENT

      long handle

      handle=OpenChannel("MyPBApp","System")

      //handle returning a large ramdom positive number

 

Now, how can i pass data between apps? That was only conection part.

Examples shows how to do it with Excel...

 

Thanks...

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 15 January 2020 18:15 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Samuel;

1) Have you tried the OpenChannel command passing in the 3rd argument (Window address)?

Note: DDE is working OK for me in PB2017R3 test on W10 ...

2) You can also the FindWindow SDK command followed by a Send/PostMessage command to communicate between PB Apps...

http://chrispollach.blogspot.com/search?q=Send+Message

3) The third alternative could be to use TCP/IP...

http://chrispollach.blogspot.com/2019/12/socket.html

HTH

Regards ... Chris

 

Comment
  1. Samuel Sanchez Avila
  2. Wednesday, 15 January 2020 18:41 PM UTC
Hello Chris.



I alter my StartSeverDDE, using a 3th argument.



StartServerDDE ("app_b","app_b","is_param")



Now im able to use setremote



ll_handle = OpenChannel("app_b","app_b")



setremote("is_param","data from A", ll_handle) // Setremote return 1



But dont know how to catch the value in APP2 from App1. I suppose that is with a getdatadde, but in a button or in open event?
  1. Helpful
  1. Samuel Sanchez Avila
  2. Wednesday, 15 January 2020 18:54 PM UTC
Never Mind GetDataDDE goes in a event called remotsend.



Thanks very much for u example.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 15 January 2020 19:44 PM UTC
Yes, you will still need to code the RemoteExec, RemoteHotLinkStart, RemoteHotLinkStop, RemoteRequest, and/or possibly the RemoteSend events - depending on the DDE features that you use.

BTW: If you would like a copy of my DDE demo App, please send me a PM and I can Zip it up for you. ;-)

Chris.Dot.Pollach.At.Appeon.Dot.com ... [edit accordingly]
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Wednesday, 15 January 2020 18:19 PM UTC
  2. PowerBuilder
  3. # 1

Two ways I can see:

1) Have a table in the database specifically for trans-application communication
    The table is empty when there is no data to transfer
    The table is populated when data is to be transferred  - with one row of data per item to be transferred
    The apps have a timer, when it expires they check the table for rowcount
    If rowcount > 0 then read the rows to see if the data is for app A or app B
    If app A is checking the table and the data is for app A, process the data then delete the row from the table
    Same for app B
    Reset the time


2) Everything is the same as above except you have a dedicated folder and each app creates files to tranfer data
    The folder is empty when there is no data to transfer
    To transfer data you create a file with the appropriate data in it
   


Olan

Comment
  1. Samuel Sanchez Avila
  2. Wednesday, 15 January 2020 18:39 PM UTC
Hello Olan.



Yes, the first one is my alternative method in case this dont work. Thanks for your reply
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 15 January 2020 20:49 PM UTC
  2. PowerBuilder
  3. # 2

I would be surprised if DDE actually worked.

You should try Winsock. It will work between two computers, something DDE cannot do.

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

 

Comment
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.