Hello, All!
I'm trying to make my program work with the database, placed on a memory
card - but I have an odd problem.
I've successfully opened the file.
I used (old code):
g_DB=DmOpenDatabaseByTypeCreator ('pref', appFileCreator, dmModeReadOnly);
Now I use:
slotParamP.vfsMountParam.mountClass = VFSMountClass_SlotDriver;
err = ExpSlotEnumerate(&slotParamP.slotRefNum, &slotIterator);
err = ExpSlotLibFind(slotParamP.slotRefNum, &(slotParamP.slotLibRefNum));
err = VFSVolumeMount(NULL, NULL, (VFSAnyMountParamPtr)&slotParamP);
err = VFSFileOpen (slotParamP.vfsMountParam.volRefNum,
"/Palm/Launcher/MyDB.pdb", vfsModeRead, &fileRef);
Then I got handles to a database records (old code):
for (i=0;i<(g_Records.m_nRecNum);i++)
g_Records.m_vhRecords[i]=DmGetRecord (g_DB, i);
Now it seems to be like this:
for (i=0;i<(g_Records.m_nRecNum);i++)
err = VFSFileDBGetRecord (fileRef, i, &(g_Records.m_vhRecords[i]),
NULL, NULL);
The next step was to obtain pointers to the records data
for (i=0;i<(g_Records.m_nRecNum);i++)
g_Pointers.pL1R[i] =(unsigned char
*)MemHandleLock(g_Records.m_vhRecords[i]);
Here's the place where I get puzzled. I tried to use the same technique and
didn't change this code, and got no error messages.
But! A strange thing happens!
After executing these lines, the program just quits without saying anything!
I even can see that I've got the data from the database, because I can see
how the form initializes with data (if I put this code into the
MainFormInit, for example)
It seems that some appStopEvent is generated by the system - but I don't
know why and what to do with it.
So the question is - how do I replace my old code to work with a memory
card??
Bye,
Eugene.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/