beautypg.com

HP NonStop G-Series User Manual

Page 24

background image

Client Programming

Introduction to the Tandem DDE Gateway

1–12

110838 Tandem Computers Incorporated

Binary-Pass-Through DDE Communication

To explain the binary-pass-through approach, the steps that the client application must
perform to retrieve employee data (as described above in SCOBOL) are shown in
Figure 1-5.

Use client code to define both the READ-REQUEST-MESSAGE and the READ-REPLY-
MESSAGE structures. In addition to the data elements required by the Tandem server,
the messages must start with a byte count set to the number of bytes in the structure
following the byte count. This byte count is used by the Tandem DDE Gateway to
determine how much data is being supplied. The byte count is not passed to the
Tandem server.

Figure 1-5. Binary-Pass-Through DDE Communications

Initiate (TDMGW , PATHWAY)

Execute ([BEGINTRANSACTION])

Poke (_TDMGW-BINARY-BUFFER, CF_TEXT, Buffer)

Execute ([SEND])

Request (_TDMGW-BINARY-BUFFER, CF_TEXT)

Data (reply message data being returned)

Execute ([ENDTRANSACTION])

Terminate

Execute ([INITIALIZESERVICE(READ-EMPLOYEE)]

Client

Application

(Binary-

Pass-

Through)

Message

Layouts

and Data

Conversion

in Client

Application

005

Tandem

DDE

Gateway

1.

Use the DDE Initiate function to start a DDE conversation with the Tandem DDE
Gateway. Use the application name TDMGW and the DDE topic name
PATHWAY. TDMGW is the file name of the Tandem DDE Gateway executable
file (TDMGW.EXE).

2.

Use the DDE Execute function to tell the Tandem DDE Gateway the transaction
type. Use the command [INITIALIZESERVICE(READ-EMPLOYEE)]. The
transaction name READ-EMPLOYEE is configured in the Tandem DDE Gateway
as a ServiceName object and cross-referenced there to a Pathway server class.

Using client application code, put the employee number in a READ-REQUEST-
MESSAGE message structure defined in the client language. You must convert the
employee number to the correct Tandem data representation, that is, a 2 byte
integer with its byte order swapped. The data conversion library provided with
the Tandem DDE Gateway can help you with the data conversions.