I'm trying to avoid DmFindDatabase. For example, if an app initially discovers a database's local ID via DmFindDatabase, stashes the ID in a record in another database, quits, and then in some subsequent invocation wants to use the stashed ID. For that to be safe, there has to be a way to validate the ID before using it, but doing a MemLocalIDToLockedPtr returns NULL in that context.
Another poster pointed out that this won't work anyway, because even if MemLocalIDToLockedPtr could be used to show that _some_ database has that ID, it won't necessarily be the same database as it was originally. I think now that using DmFindDatabase is unavoidable. Mark Peters "Joe" <[EMAIL PROTECTED]> wrote in message news:83098@palm-dev-forum... > > --- "Mark A. Peters" wrote: > > I have tried using the Memory Manager functions for > > converting LocalID's to pointers for this, but they > > always return a NULL value when given even a valid dbID. > > That's surprising. In the following code, MemLocalIDToLockedPtr() > doesn't return NULL when I run it: > > MemPtr p; > LocalID local; > UInt16 cardNo = 0; > > local = DmFindDatabase( cardNo, "Memo Pad" ); > p = MemLocalIDToLockedPtr( local, cardNo ); > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Tax Center - online filing with TurboTax > http://taxes.yahoo.com/ > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
