Structure of the Presentation Space

Personal Communications returns the presentation space in the format specified in the Get Presentation Space request.

If the format is CF_DSPTEXT, Personal Communications returns the presentation space in the following format:
typedef struct tagPS_CF_DSPTEXT
{
 unsigned Unused:12,           // Unused
 unsigned fResponse:1,         // TRUE = DDE_REQUEST response
 unsigned fRelease:1,          // TRUE = client frees the storage
 unsigned reserved:1,          // **** Reserved ****
 unsigned fAckReq:1,           // TRUE = DDE_ACK requested
 int      cfFormat;            // Format data is rendered in
 unsigned uPSSize;             // Size of the presentation space
 unsigned uPSRows;             // PS number of rows
 unsigned uPSCols;             // PS number of columns
 unsigned uPSOffset;           // Offset to the presentation space
 unsigned uFieldCount;         // Number of fields
 unsigned uFieldOffset;        // Offset to the field array
 unsigned char PSData[1];      // PS and Field list Array
} PS_CF_DSPTEXT, FAR *lpPS_CF_DSPTEXT;
 
typedef struct tagPSFIELDS
{
 unsigned char cAttribute;     // Attribute Character
 unsigned uFieldStart;         // Field start offset
 unsigned uFieldLength;        // Field Length
} PSFIELDS, FAR *lpPSFIELDS;
Note: The following examples show how to obtain long pointers to the PS and the PSFIELDS array.
  lpps = (lp_PS_CF_DSPTEXT) lpPS_CF_DSPTEXT->PSData
       + lpPS_CF_DSPTEXT->uPSOffset;
  lppsfields = (lpPSFIELDS) lpPS_CF_DSPTEXT->PSData
             + lpPS_CF_DSPTEXT->uFieldOffset;
If the format is CF_TEXT, Personal Communications returns the presentation space in the following format:
typedef struct tagPS_CF_TEXT
{
 unsigned      Unused:12;       // **** Unused ****
 unsigned      fResponse:1;     // TRUE = DDE_REQUEST response
 unsigned      fRelease:1;      // TRUE = Client frees this data
 unsigned      reserved:1;      // **** Reserved ****
 unsigned      fAckReq:1;       // TRUE = Client returns DDE_ACK
 int           cfFormat;        // Format of the data
 unsigned char PSSIZE[4];       // Size of the PS
 unsigned char Tab1[1];         // Tab character
 unsigned char PSROWS[4];       // Number of rows in the PS
 unsigned char Tab2[1];         // Tab character
 unsigned char PSCOLS[4];       // Number of Cols in the PS
 unsigned char Tab3[1];         // Tab character
 unsigned char PS[1];           // PS
} PS_CF_TEXT, FAR *lpPS_CF_TEXT;
Following the PS in the buffer is the following additional structure of fields that compose the field list.
typedef struct tagFL_CF_TEXT
{
 unsigned char Tab4[1];       // Tab character
 unsigned char PSFldCount[4]; // Number of fields in the PS
 unsigned char Tab5[1];       // Tab character
 PS_FIELD      Field[1];      // Field List Array
} FL_CF_TEXT, FAR *lpFL_CF_TEXT;
 
typedef struct tagPS_FIELD
{
 unsigned char FieldStart[4];
 unsigned char TabF1[1];
 unsigned char FieldLength[4];
 unsigned char TabF2[1];
 unsigned char Attribute;
 unsigned char TabF3[1];
} PS_FIELD, FAR *lpPS_FIELD;
Note: The following example shows how to obtain long pointers to the PS and the PS_FIELD array.
  lpps = lpPS_CF_TEXT->PS;
  lpps_field = (lpPS_FIELD) lpPS_CF_TEXT->PS
             + atoi(lpPS_CF_TEXT->PSSIZE)
             + ((atoi(lpPS_CF_TEXT->PSROWS) - 1) * 2) // CR/LF
             + 1 + 1 + 4 + 1;   // Tabs + size of field count