> -----Original Message----- > From: Alan Ingleby > Sent: Thursday, August 14, 2003 10:51 PM > > "Jeff Ishaq" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Sometimes I can't pass the refNum as a > > > parameter, like in Application-defined functions. LionScribe > > > I don't follow you. If your application has installed / loaded a > > shared library, then it must know that library's reference > number. So > > you should have no problem passing it around. Perhaps I'm > missing the > > question here? > > Perhaps he's referring to system callbacks in his code, where > the calling code may not have local access to the library's > ref number. If that's the case, there's two solutions. 1) > Store the refNum in a global. 2) use SysLibFind to get the > ref number for an already-loaded library.
Oh, I see. Hmm, I can't think of any Palm OS callbacks that don't provide at least one user-defined field into which one could stash a UInt16, or a pointer to a UInt16. Barring that, one can always use the Feature Manager to stash the refNum. Or a global, if they are available. But using SysLibFind() is probably the cleanest solution for the long term, at the expense of a few StrCompare()s for each call. HOWEVER, I wouldn't call this API in a sorting routine callback (a DmCompareF*, for example) because it would incure tons of overhead. -Jeff Ishaq -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
