> 2. Also, this is the struct that I think is causing the stack overflow. It
is in the SaveFormDoCommand that I try to fill it up with data. I believe
that
> if I can reduce its stack usage, my problem is solved. Can aI lso use
MemPtrNew to allocate this struct in the heap instead of the stack? If so,
how can I
> go about it?

> typedef struct{
> char com1[30];
> ** snip **
> char com60[30];
> char com61[30];
> } ComDB;

I'm just guessing here being a Palm newbie, but since the usual C API way is
to do:

ComDB * mysavestruct = (ComDB*)malloc(sizeof(ComDB));

Then therefore the MemPtrNew way would be:

ComDB * mysavestruct = (ComDB*)MemPtrNew(sizeof(ComDB));

You'd access the variables using the -> operator i.e.

mysavestruct->com1[0]=0;

instead of:

mysavestruct.com1[0]=0;


If I'm wrong, I hope someone puts me right 'cos I'm bound to come across
this shortly.

Doesn't malloc() work in Palm like on all the other API sets?


Mark


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to