Communication between Uniface applications

Author: s.bisseux@gie.codelog.fr (Stephane BISSEUX)

hello I need to run two distinct Uniface applications and make them talk together. Each application is a uniface.exe process using different asn and ini files. What is the best way to activate several "uniface.exe" process and allow communication between them? In application A, how can I send message to application B? (in app A, can I use postmessage instruction? do I need an handle on application B? if yes, how can I get this handle?...) The aim of this, is to build a tool wich will be able to manage component version, export and compile component from/to different uniface environments (DEV, TEST, VALIDATION, PRODUCTION, ...) Any help will be appreciate Stéphane

6 Comments

  1. There is a 2 part video on the YouTube channel entitled "Postmessage and Message API" that covers this thread. So, as suggested, spawn and OS signatures are not required. The postmessage and various $msgXXX statements can handle this. The main thing not mentioned so far is how each Uniface process can register with the local URouter (this is required). Either the uniface.exe command line includes a /ust=??? switch, or you use the open statement on path $DNP to add a UST. In either case, USTs need to be unique within each URouter. That's easy to do with an open proc statement, but still possible if you are building up command lines with proc statements to process via a spawn or OS command signature call. The video also discussed the use of the message API to allow non-Uniface applications to post messages to a Uniface component, or startup shell.


    Author: Eddy Knochs (eknochs@ozemail.com.au)
  2. When transferring between applications, the reply address is "%%$instancepath%%%:%%$instancename%%%" not just the instancename. (Note there's a colon in the middle.) This is necessary to post messages between uservers on a server and the uniface.exe on the client, so try this.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  3. If you know the reply address of the target, you can use a postmessage instruction, as long as the two processes share a urouter. Outsides of a connection within the same machine, I'd suggest web services. So to transfer to a production server from a development server, web services can allow communication with a userver.exe process on the other machine.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  4. Hi FiresongKt "If you know the reply address of the target, you can use a postmessage instruction" --> this is the point where the problem is : How can I get the reply adress of a process launch with a spawn command (spawn 'uniface.exe ....) I tried to launch uniface.exe via the activation of a signature with an OS command implementation : activate "OS_SIGNATURE".COMMAND("uniface.exe /asn=... ") Result: 1- An uniface process is launched, but the app isn't visible for the user. 2- With this kind of signature, I can't use newinstance (status -166 because this signature has no real implementaion) --> so I don't have any reference to the target. Any idea about the way to create a new uniface process and get his adress? thanks


    Author: Stephane BISSEUX (s.bisseux@gie.codelog.fr)
  5. Add the reply address of the calling process as an argument? spawn "uniface.exe /asn...... myappl %%reply_address%%% " According to the docs, the reply address will then be located in $1. Use this reply address to post a message back from the started application giving it's own reply address.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  6. a good idea, but it seems that messages sent from application A are not received in application B. In application A, the main form is "Form_A". $instancename or $instancehandle returns "FORM_A" and I send it to application B as a parameter at the end of command line. In application B, "FORM_B" is activated and I receive in $1 the name of the "parent form" sent by application A ($1 contains "FORM_A" as expected) In app B, I use the command : postmessage "FORM_A", "xxxxx", "yyyyy" Asynchronous Interrupt is not fired in application A. Did I miss something? Confused


    Author: Stephane BISSEUX (s.bisseux@gie.codelog.fr)