IASEngine_CreateObject return error(0x10) | developer.brewmp.com IASEngine_CreateObject return error(0x10) | developer.brewmp.com

Developer

IASEngine_CreateObject return error(0x10)

Dear, All

Anyone who met the same issue: when create IASObject in AS Extension, just return 0x10.
sample code as below:

static int sqlExt_dbc_getData(sqlExt* pMe, IASArgs * piArgs)
{
IASObject * piObjDataSet = NULL;
IASArgs *piArgsSet = NULL;
int nErr = AEE_SUCCESS;
int nCount =0;
int nColumn =0;
int32 rqCount =0;

//Make sure AS call with 2 parameters, or query all rows, fix later.
nErr = IASArgs_GetAsObject(piArgs, 0, &piObjDataSet);
nErr |= IASArgs_GetAsInteger(piArgs, 1, &rqCount);

nErr |= dbc_IResultSet_GetColumnCount(pMe->pRltSet,&nColumn);
//dataview[i]= {value1,value2,...};
if(AEE_SUCCESS != nErr)
{
DBGPRINTF("[EX]:sqlExt_dbc_getData failed! Check the input parameter");
nErr = EFAILED;
return 0;
}

if(rqCount > 0)
{
nErr = IASEngine_CreateArgs(pMe->piEngine,rqCount, &piArgsSet);
}
else
{
DBGPRINTF("[EX]:sqlExt_dbc_getData failed! check your second param!");
nErr = EFAILED;
return 0;
}
dbc_IResultSet_Reset(pMe->pRltSet);
while(dbc_ROW == dbc_IResultSet_Next(pMe->pRltSet))
{
IASArgs *piArgsLocal = NULL;
IASObject *piObjectLocal = NULL;
//const char test[32] = {0};
int i;
dbc_ColDataType dType;
//Here will reture 0x10, if I Add an temp IASArgs * piTempArgs like, it also return error
//nErr |= IASEngine_CreateObject(pMe->piEngine,"temp",piTempArgs,&piObjectLocal); //-> return 0x10
nErr |= IASEngine_CreateObject(pMe->piEngine,"temp",NULL,&piObjectLocal);//-> return 0x10

nErr |= IASEngine_CreateArgs(pMe->piEngine,nColumn, &piArgsLocal);

for(i =0;i < nColumn;i++)
{
nErr |= dbc_IResultSet_GetColumnDataType(pMe->pRltSet,i,&dType);
if(dType == dbc_COL_DT_INTEGER)
{
int nCValue;
nErr |= dbc_IResultSet_GetInt(pMe->pRltSet,i,&nCValue);
nErr |= IASArgs_SetToInteger(piArgsLocal,i,nCValue);
}
else if(dType == dbc_COL_DT_FLOAT)
{
double nCValue;
nErr |= dbc_IResultSet_GetDouble(pMe->pRltSet,i,&nCValue);
nErr |= IASArgs_SetToInteger(piArgsLocal,i,(int)nCValue);
}
else if(dType == dbc_COL_DT_TEXT)
{
char *pCValue;
int lenReq;;
nErr = dbc_IResultSet_GetText(pMe->pRltSet, i, NULL, 0, &lenReq);
if(AEE_SUCCESS != nErr)
{
DBGPRINTF("dbc_IResultSet_GetText failed");
continue;
}
pCValue = (char *)MALLOC((uint32)lenReq);
if(pCValue == NULL)
{
DBGPRINTF("dbc_IResultSet_GetText failed");
continue;
}
nErr = dbc_IResultSet_GetText(pMe->pRltSet, i, pCValue, lenReq, &lenReq);
nErr |= IASArgs_SetToString(piArgsLocal,i,pCValue);

if(AEE_SUCCESS != nErr)
{
DBGPRINTF("dbc_IResultSet_GetText failed");
continue;
}

}
else
{
continue;
}

}
nErr |= IASObject_PushArgsToArray(piObjectLocal,piArgsLocal);
nErr |= IASArgs_SetToObject(piArgsSet,nCount,piObjectLocal);

//release piArgsLocal and piObjectLocal
IQI_RELEASEIF(piArgsLocal);
IQI_RELEASEIF(piObjectLocal);
if(AEE_SUCCESS == nErr)
{
nCount ++;
}
}

nErr |= IASObject_PushArgsToArray(piObjDataSet,piArgsSet);
//release piArgsSet
IQI_RELEASEIF(piArgsSet);
IQI_RELEASEIF(piObjDataSet);
return nCount;

Help!!!!!!!!!