I am having trouble using ExgDBRead... When I make the call (below), the error that is returned is dmNotValidRecord:

sTempFile file;
file.fname = fname;
file.curPos = 0;
err = ExgDBRead(MyReadDBProc, MyDelDBProc, &file, pDBID, 0, &needReset, true);


Here is the callback:

static Err MyReadDBProc(void *dataP, UInt32 *sizeP, void *userDataP)
{
   Err err = errNone;
   sTempFile    *pFile = (sTempFile*) userDataP;

FILE_REF frp = FileOpen(0, pFile->fname, sysFileTFileStream, dOnlineCreatorID, fileModeReadOnly, &err);
if (err == errNone)
{
err = FileSeek(frp, pFile->curPos, fileOriginBeginning);
if (err == errNone)
{
*sizeP = FileRead(frp, dataP, 1, (Int32) (*sizeP), &err);
pFile->curPos = FileTell(frp, NULL, NULL);
if (FileEOF(frp)) err = errNone;
}
}
return err;
}


I can trace the first pass into the callback, and it appears to read the first 72 bytes of the stream (looks like the database header in memory).. and it returns from the callback with no error.

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

Reply via email to