Data Transformation Engine Platform API Reference Guide

Chapter 2 - Using the Platform API Data To and From the Platform API
Platform API Reference Guide
lpDataToApp
'DWD7RDQG)URPWKH3ODWIRUP$3,
-IE
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 */
/* -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);
/* call the function to map it */
RunMap(&ExitParam);
/* lpDataFromApp contains the string representation of nReturn */
.
.
.
return 0;
}