At 3:50 PM +0800 12/17/99, Garry Chiang wrote:
>Does Palm store the AppInfoBlock in dynamic RAM
>or storage RAM?
It belongs in the storage heap. Your problem is that you're creating it in the dynamic
heap. Use DmNewHandle to allocate a chunk. Here's a snippet:
(DmOpenRef dbP)
LocalID databaseID, appInfoID;
Handle appInfoH;
BytePtr appInfoP;
DmOpenDatabaseInfo(dbP, &databaseID, NULL, NULL, NULL, NULL);
appInfoH = DmNewHandle(dbP, <app info block size goes here>);
appInfoP = MemHandleLock(appInfoH);
DmWrite(appInfoP, 0, <initial app info data goes here>, <app info block size
goes here>);
MemPtrUnlock(appInfoP);
appInfoID = MemHandleToLocalID(appInfoH);
DmSetDatabaseInfo(kCardNumber, databaseID, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, &appInfoID, NULL, NULL, NULL);
Note that I'm ignoring error results in this code, not something I'd ever do in real
code!
-
Danny Epstein, Applied Thought Corporation
Have friends with Palm organizers? Get BeamBooks!
http://www.appliedthought.com/beambooks