Michael wrote:
I'm using 3rd party libs to retrive the file thr internet.
The lib only can save into filestream rather than the rec
db. I'm newbie in Palm OS program with C.
In that case, it will be easiest to just save it to a filestream
and then read it out of there. That uses extra space, but it
may not be all bad. For one thing, you can check that you got
the whole file before trying to decode it, which may make error
handling easier.
If ExgDBRead
can work. How ? thanks
Define a callback that you can pass as the first argument of
ExgDBRead(). This callback should use FileRead() to read
from a File Stream handle.
Then, open the file with FileOpen(). Call ExgDBRead() and
pass the callback as the first argument. It will call your
callback over and over until it has read all the data it
needs. When ExgDBRead() returns, the database should exist
on the device (or an error will be returned).
Your callback will need the filehandle to read from. You
can pass this through as the third argument to ExgDBRead()
(userDataP). I would pass a FileHand*. Then inside the
callback, cast the void* back to a FileHande* and dereference
it to get back the FileHand that you need to pass to
FileRead().
Note: you should probably just pass 0 as the card number
for the fifth argument to ExgDBRead(). All modern Palm OS
devices just use one card.
- Logan
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/