> > Fixed !
>
> maybe it is good to say how you fixed it :) so, the next person who
> does a search in the archives for this error or similar can get a
> hint of a possible solution?
>
Yes,

I want to move a database from a memory card and a temporaly rename
the existing database on device in case of crash, i use this code :

    // get current db info and rename it
    DmOpenDatabaseInfo(_dbP, &oDbID, 0, 0, &oCardNo, 0);
   GamCloseDatabase(true);    // internal function to close the currently
opened DB
   DmSetDatabaseInfo(oCardNo, oDbID, "ScummVM-Data-old.pdb", 0, 0, 0, 0, 0,
0, 0, 0, &type, 0); // rename the DB

   // try to import the new DB
   e = VFSImportDatabaseFromFile(gPrefs->card.volRefNum,
"/Palm/Programs/ScummVM/listdata.pdb", &nCardNo, &nDbID);

   if (e) {
    // if an error occured reset the DB name
    type = 'DATA';
    FrmCustomAlert(FrmErrorAlert, "Failed to import games database from
memory card.", 0, 0);
    DmSetDatabaseInfo(oCardNo, oDbID, "ScummVM-Data.pdb", 0, 0, 0, 0, 0, 0,
0, 0, &type, 0);
   } else {
   // if success get the new (?) LocalID of the old DB and delete it
    // in OS5 the localID may change ... ? (cause Free Handle error)
    oDbID = DmFindDatabase (oCardNo, "ScummVM-Data-old.pdb");
    DmDeleteDatabase(oCardNo, oDbID);
   }
   GamOpenDatabase(); // open the new DB

It seems that EvtGetEvent perform some DB integrity check
and cause the Free Handle 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