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 char data[(sizeof(DDEDATA)-1)];
unsigned short uPSSize; /* Size of the presentation space
unsigned short uPSRows; /* PS number of rows
unsigned short uPSCols; /* PS number of columns
unsigned short uPSOffset; /* Offset to the presentation space
unsigned short uFieldCount; /* Number of fields
unsigned short uFieldOffset; /* Offset to the field array
unsigned char PSData_1¨; /* PS and Field list Array(lpPSFIELDS)
} PS_CF_DSPTEXT;
typedef union tagDDE_PS_CF_DSPTEXT
{
DDEDATA DDEdata;
PS_CF_DSPTEXT DDEps;
} DDE_PS_CF_DSPTEXT, *lpDDE_PS_CF_DSPTEXT;
typedef struct tagPSFIELDS
{
unsigned short uFieldStart; /* Field start offset
unsigned short uFieldLength; /* Field Length
unsigned char cAttribute; /* Attribute character
unsigned char ubReserved; /* *** Reserved ***
} PSFIELDS, *lpPSFIELDS;
Note:
The following examples
show how to obtain long pointers to the PS and the PSFIELDS array.
lpDDE = (lpDDE_PS_CF_DSPTEXT)GlobalLock(hData);
lpps = lpDDE->DDEps.PSData + lpDDE->DDEps.uPSOffset;
lppsfields = lpDDE->DDEps.PSData + lpDDE->DDEps.uFieldOffset;If the format is CF_TEXT, Personal Communications returns the presentation space
in the following format:
typedef struct tagPS_CF_TEXT
{
unsigned char data[(sizeof(DDEDATA)-1)];
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;
typedef union tagDDE_PS_CF_TEXT
{
DDEDATA DDEdata;
PS_CF_TEXT DDEps;
} DDE_PS_CF_TEXT, *lpDDE_PS_CF_TEXT;Following the PS in the buffer is the following additional structure
of fields that compose the field list.
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, *lpPS_FIELD;
Note:
The following example
shows how to obtain long pointers to the PS and the PS_FIELD array.
lpDDE = (lpDDE_PS_CF_TEXT)GlobalLock(hData);
lpps = lpDDE->DDEps.PS;
lpps_field = lpDDE->DDEps.PS
+ atoi(lpDDE->DDEps.PSSIZE)
+ ((atoi(lpDDE->DDEps.PSROWS) -1) * 2) // CR/LF
+ 1 + 1 + 4 + 1; // Tabs + size of field count