I'm writing a level editor that can have several databases installed (from
different sources, but all with the same structure).

Anyway, I've managed to get the editor to create the databases on request,
which fills the following structure into the AppInfo block:-

struct LevelPackHeader
 {
 char szPackName[30];
 char szAuthor[30];
 int  nLevels;
 char szFinishedMsg[250];
 };

I'm storing this with the following code (error handling etc removed for
brevity)

err = DmOpenDatabaseInfo(db, &dbID, NULL, NULL, &cardNo, NULL);
h = DmNewHandle(db, sizeof(LevelPackHeader));
appInfoID = MemHandleToLocalID(h);
err = DmSetDatabaseInfo(cardNo, dbID, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, &appInfoID, NULL, NULL, NULL);
appInfoP = (LevelPackHeader*) MemHandleLock(h);
err = DmSet(appInfoP, 0, sizeof(LevelPackHeader), 0); // Clear
err=DmWrite(appInfoP, 0, FillFrom, sizeof(LevelPackHeader));
MemPtrUnlock(appInfoP);

But I can't for the life of me work out how to read this information...the
idea is I'm iterating through the databases that are created on the device
and displaying them in a list. The list is supposed to read the szPackName
variable from the AppInfo block of each database, but I just can't work out
how to get this structure back.....

can anyone help ?

Cheers,
Tony


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

Reply via email to