Re: API ARExport

2006-12-06 Thread Misi Mladoniczky
Hi Frank,

That was a very short snippet...

Here is a couple of lines from rrrChive for the version 5.1.2:

ARStructItemList exportobjects;
exportobjects.numItems = 1;
exportobjects.structItemList = (ARStructItemStruct *) m_calloc(1,
sizeof(ARStructItemStruct));
exportobjects.structItemList[0].type = AR_STRUCT_ITEM_SCHEMA;
strncpy(exportobjects.structItemList[0].name, target_form,
sizeof(ARNameType));
exportobjects.structItemList[0].selectedElements.numItems = 0;
exportobjects.structItemList[0].selectedElements.nameList = NULL;

char *exportbuf = NULL;

msglevel = ARExport(target, &exportobjects, NULL, 0, &exportbuf, &status);
if(msglevel > AR_RETURN_WARNING || status.numItems)
  mlog->Log(__FILE__, __LINE__, LOG_TYPE_ARS, msglevel, 0,
"ARExport(server=%s, form=%s)\n%s", target->server, target_form,
sp.Print(&status, msglevel));
FreeARStatusList(&status, FALSE);
if(msglevel > AR_RETURN_WARNING)
{
// Is this a bug? I cant free the export buffer without crashing
//  if(exportbuf)
//  free(exportbuf);
  m_free(exportobjects.structItemList);
  return;
}

Best Regards - Misi, RRR AB, http://www.rrr.se

> Env: ARS Server 6.03 on Solaris/Sybase
>
>>From Windows attempting to make an ARExport call using the C API in
>> Visual
> Studio. Trying to export 1 Filter. My code compiles without issue but I
> keeping get the error "Malloc failed on server".
>
> A snippet of the code:
> ARExport(&control,&structItems,NULL,AR_VUI_TYPE_NONE,NULL,&returnStr,&status)
>
> Any ideas?
> Anyone whose used this APIcall willing to share some code?
>
> Thank you.
>
> ___
> UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where
> the Answers Are"
>

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"


API ARExport

2006-12-06 Thread Frank Caruso
Env: ARS Server 6.03 on Solaris/Sybase

>From Windows attempting to make an ARExport call using the C API in Visual
Studio. Trying to export 1 Filter. My code compiles without issue but I
keeping get the error "Malloc failed on server".

A snippet of the code:
ARExport(&control,&structItems,NULL,AR_VUI_TYPE_NONE,NULL,&returnStr,&status)

Any ideas?
Anyone whose used this APIcall willing to share some code?

Thank you.

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"