Please enable JavaScript to view this site.

ESL Documentation

Field Types

Called from a user-written DLL subroutine to obtain a buffer of data sent by a partner application upon notification that the data has become available.

C Language

The declarations for this subroutine and for the integer constants Declaration: that can be used with it are found in the ESL APPC C language include file (ESLAPPC.H).

APPCGetDLLData is declared in the include file, ESLAPPC.H., according to the following syntax:

USHORT APIENTRY

APPCGetDLLData(ULONG   CONVERSATION_ID,

               PPBYTE  BUFFER_POINTER,

               PUSHORT BUFFER_LENGTH);

Arguments:

CONVERSATION_ID is an unsigned long value containing the conversation identifier (handle) for the APPC conversation returned by either APPCStart or APPCAcceptStart.

BUFFER_POINTER is a pointer to a pointer variable that is set to the address of a buffer. This buffer contains the data received from the partner. The pointer to the buffer is returned. The buffer must be freed in the following manner:

LocalFree(*BUFFER_POINTER);

BUFFER_LENGTH is a pointer to an unsigned short value that will contain the length of the data buffer.

Errors:

APPC_NORMAL_COMPLETION

Normal completion.

APPC_ERR_OUT_OF_MEMORY

Out of memory.

APPC_ERR_INV_CONV_ID

Invalid argument: CONVERSATION_ID

APPC_ERR_INV_BUFFER_POINTER

Invalid argument: BUFFER_POINTER

APPC_ERR_INV_BUFFER_LENGTH

Invalid argument: BUFFER_LENGTH pointer is zero.

APPC_ERR_UNEXPECTED_ERROR

Unexpected error encountered.

Examples:

In the ESL program:

# Response to data from partner
response to stimulus APPC_EVENT APPC_Data ConvID
 call MyAppGetData
 

 ( ConvID, # Handle from Start/AcceptStart
 Int1, # From BufInt1
 String1, # From BufStr1
 String2, # From BufStr2
 String3 ) # From BufStr3

In the user-written DLL routine:

/* MyAppGetData, a routine written in C */
 

#include <eslappc.h> /* Defines to call functions */
 

typedef struct { /* Format of data to send/receive */
 unsigned long BufInt1;

 char         BufStr1[80];

 char         BufStr2[16];

 char         BufStr3[40]; 

 } INPUTAREA; 

 

INPUTAREA *MyBuf;         

PBYTE      pData;         

ULONG      ConvID;         

USHORT     Length;        

 

APPCGetDLLData ( ConvID, /* Handle from Start/AcceptStart */
                 &pData, /* Buffer returned */
                 &Length );/* Length of data in buffer */
 

MyBuf = (INPUTAREA *)pData;
// Process data received
 

 . . .
 

LocalFree(pData);