Discussion:
Application Information Block, how to access
(too old to reply)
Scott Allen
2004-02-17 00:59:09 UTC
Permalink
Hi,

Does anyone have a sample of code (c or c++ preferably) that
demonstrates the reading of a Palm pdb's Application Information Block
(appInfo)? Even just an explination of how to access it would help me
a lot.

I've looked in a few books and searched online, but so far have only
been able to find out on what appInfo is, but not how to actually
access the data it contains.

Thanks very much,

-Scott
Scott Allen
2004-02-18 17:00:15 UTC
Permalink
Ok, I finally found a thread someone posted some time back concerning
accessing a pdb's Application Information Block (AppInfo) which gave a
general nod in the direction of the source for Pilot-DB
(http://pilot-db.sourceforge.net/) in order to find the answer to how
to access the AppInfo block.

Pilot-DB has a nice function in Chooser.c called AppInfoInit() that
sets and gets the AppInfo block for a pdb.

I only needed the "get" part, so here's the code I ended up using.
APP_INFO is the struct for the particlar AppInfo block I was grabbing,
so you'll need to replace that with your struct. dbAppData is the pdb
who's AppInfo block I'm accessing. appInfoPtr will contain your
AppInfo Block data.

LocalID dbID, appInfoID;
UInt16 cardNo;
APP_INFO *appInfoPtr;

DmOpenDatabaseInfo(dbAppData, &dbID, NULL, NULL, &cardNo, NULL);
DmDatabaseInfo(cardNo, dbID, 0, 0, 0, 0, 0, 0, 0, &appInfoID, 0, 0,
0);
appInfoPtr = MemLocalIDToLockedPtr(appInfoID, cardNo);

-Scott
Post by Scott Allen
Hi,
Does anyone have a sample of code (c or c++ preferably) that
demonstrates the reading of a Palm pdb's Application Information Block
(appInfo)? Even just an explination of how to access it would help me
a lot.
I've looked in a few books and searched online, but so far have only
been able to find out on what appInfo is, but not how to actually
access the data it contains.
Thanks very much,
-Scott
Scott Allen
2004-02-18 17:26:26 UTC
Permalink
Ok, I found a thread someone posted some time back concerning
accessing a pdb's Application Information Block (AppInfo) which gave a
general nod in the direction of the source for Pilot-DB
(http://pilot-db.sourceforge.net/) in order to find the answer to how
to access the AppInfo block.

Pilot-DB has a nice function in Chooser.c called AppInfoInit() that
sets and gets the AppInfo block for a pdb.

I only needed the "get" part, so here's the code I ended up using.
APP_INFO is the struct for the particlar AppInfo block I was grabbing,
so you'll need to replace that with your struct. dbAppData is the pdb
who's AppInfo block I'm accessing. appInfoPtr will contain your
AppInfo Block data.

LocalID dbID, appInfoID;
UInt16 cardNo;
APP_INFO *appInfoPtr;

DmOpenDatabaseInfo(dbAppData, &dbID, NULL, NULL, &cardNo, NULL);
DmDatabaseInfo(cardNo, dbID, 0, 0, 0, 0, 0, 0, 0, &appInfoID, 0, 0,
0);
appInfoPtr = MemLocalIDToLockedPtr(appInfoID, cardNo);

-Scott
Post by Scott Allen
Hi,
Does anyone have a sample of code (c or c++ preferably) that
demonstrates the reading of a Palm pdb's Application Information Block
(appInfo)? Even just an explination of how to access it would help me
a lot.
I've looked in a few books and searched online, but so far have only
been able to find out on what appInfo is, but not how to actually
access the data it contains.
Thanks very much,
-Scott
Loading...