Data Transformation Engine Platform API Reference Guide

Chapter 2 - Using the Platform API Data To and From the Platform API
Platform API Reference Guide
-OE lpDataFromApp
nReturn. nReturn 0 lpDataFromApp
0
-OE lpDataFromApp
-OE
-oe1 lpDataToApp
lpDataFromApp
nReturn dwFromLen
EXITPARAM
int main(void)
{
EXITPARAM ExitParam;
LPBYTE lpBuf;
DWORD dwLen;
char szbuf[50];
int nlen;
/* do user stuff to get buffer and length of buffer to map */
.
.
.
/* dwLen is length of input data */
/* lpBuf is the buffer that contains the input data */
/* create the command line */
/* -ie1 means “echo” in input for source number 1 */
/* in this example, we will use the size option with the -ie option */
/* to tell the API the size of the input */
sprintf(szbuf, “mymapp.mmc -ie1s%d “, dwLen);
nlen = strlen(szbuf);
/* allocate storage space for lpDataToApp */
ExitParam.lpDataToApp = malloc(dwLen + 100);
ExitParam.dwSize = sizeof(EXITPARAM);
ExitParam.lpv = NULL;
/* assign it to lpDataToApp */
memcpy(ExitParam.lpDataToApp, szbuf, nlen);
memcpy(&ExitParam.lpDataToApp[nlen], lpBuf, dwLen);
/* now add in the -oe1 option to get the data that was mapped back */
memcpy(&ExitParam.lpDataToApp[nLen + dwLen], “ -oe1”, 5);
/* call the function to map it */
RunMap(&ExitParam);