I did something similar to that for a program I wrote
- if you go to the archives, a couple of days ago I
asked a question about FldDrawField - I believe I
posted source code for it... then again, I'm running
on 9 hrs sleep over the past 2 nites, so I might be
wrong - either way, if you'd like me to send you my
code for reading from a struct and posting the
string(in my case) to a field, just say the word -
I'll be more than happy to send it along later
today...
-Craig
--- Tony Johnson <[EMAIL PROTECTED]> wrote:
> 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/
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/