This example first sets the values of an existing layout object then queries these values using the LayoutQueryValues function.
#include <layout.h>
LAYOUT_OBJECT plh;
LAYOUT_VALUES layout[3];
LAYOUT_TEXT_DESCRIPTOR Descr;
PLAYOUT_TEXT_DESCRIPTOR Pdescr ;
BOOL CallerAllocate;
ULONG index;
ULONG RC;
layout[0].name= CallerAllocMem;
layout[0].value=&CallerAllocate;
CallerAllocate = TRUE ;
layout[1].name = 0 ;
/* Set the LayoutValues */
RC=LayoutSetValues (plh,layout,&index);
if (RC)
{
printf("SetValue Error at index %d !!!\n",index);
exit(0);
}
Pdescr = (PLAYOUT_TEXT_DESCRIPTOR)malloc(sizeof (LAYOUT_TEXT_DESCRIPTOR));
layout[0].name = Orientation;
layout[0].value = Pdescr;
layout[1].name=0; /* End of change */
RC = LayoutQueryValues(plh,layout,&index);
if (RC)
{
printf("QueryValue Error at index %d !!!\n",index);
exit(0);
}
printf("Orientation in = %lx out = %lx",Pdescr->in,Pdescr->out);
free(Pdescr);
RC = LayoutDestroyObject(plh);
if (RC) { printf(" DESTROY Error!!!\n"); exit(0);}
************************************************************