--- Peter Briggs wrote:
> I'm using Pacific Neo-Tek's Omniremote library 

I don't know anything about that, but...

> // my Channel structure:
> typedef struct {
>   const Char  *name;
>   UInt16      sampleLength;
>   UInt8       *sample;
> } Channel;
> ...
>   length = StrLen(channel->name) + 
>      sizeof(channel->sampleLength) + 
>      sizeof(channel->sample) +  1;

Instead of sizeof(channel->sample), shouldn't you use
sampleLength ?

>   DmWrite(RecPointer, offset, channel, length);
>     MemPtrUnlock(RecPointer);

This writes length bytes starting at the address of
channel.  Starting at that address is:
  - a pointer (not a string): 4 bytes
  - a UInt16: 2 bytes
  - another pointer: 4 bytes
  - whatever happens to follow this in memory

Without even looking at how you read this data, it is
clear that it won't work.  You need to write the
actual data to your db.


__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

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

Reply via email to