Function : Composite Data

EnumCompositeBuffer - Call action routine for each Composite Data record in a buffer.
----------------------------------------------------------------------------------------------------------

#include <ods.h>

STATUS LNPUBLIC EnumCompositeBuffer(
BLOCKID ItemValue,
DWORD ItemValueLength,
ActionRoutinePtr ActionRoutine,
void far *vContext);

Description :

This function parses the value block of an item of type TYPE_COMPOSITE in a buffer. For each CD record in this item, it calls an action routine specified by the user. Since each CD record may have a different header and a different length, parsing a CD buffer is fairly complex. Therefore, this function is the recommended way to access the CD records that constitute a TYPE_COMPOSITE item.

This function takes, as input, the BLOCKID of the value of a TYPE_COMPOSITE item, its length in a DWORD, the address of an Action Routine (the Action Routine is supplied by the user), and the address of any data (for context) that is to be passed to the Action Routine. It then calls the Action Routine once for each CD record in the item, until the entire item is processed.

Parameters :

Sample Usage :

#include <ods.h>

{
/*
* typedef of a pointer pointer to the action routine is in ods.h
*
*
* typedef STATUS (LNCALLBACKPTR ActionRoutinePtr)(char far *,
*                                              WORD,
*                                              DWORD,
*                                              void far *);
*/


  ActionRoutinePtr Action;  /* Pointer to action routine for
                               EnumCompositeBuffer. */

/*
* Get pointer to the action routine to be invoked by
* EnumCompositeBuffer.
*/

  Action = (ActionRoutinePtr) MakeProcInstance(FormFields, hInst);
   
/*
* For each CD record found in the Body of the Form note,
* EnumCompositeBuffer will invoke the action routine FormFields.
*/

  sError = EnumCompositeBuffer(ValueBlockID,
                                 dwLength,
                                 Action,
                                 pOutputBuffer);
}


See Also :

ConvertItemToCompositeExt
----------------------------------------------------------------------------------------------------------