Matthew Darkstorm Bevan wrote:
>
> Most of my Common/UI resources are either below 1000 or above 9000 (but
> below the system-reserved 10,000).  The way this works is the system
> looks for requested resources (forms and whatnot) in the
> most-recently-opened-database first, then in other databases by order of
> opening.  Thus it will look in the library, then the application, then
> the system.
>
> There is no way to hide resources in your library from the active
> application that is using it, so be careful when assigning resource IDs!

LionScribe wrote:
>
> You also have to have the library open up it's own database on it's first
> time starting, and closing DB on exit.

LionScribe is right; AFAICT (on OS 5, at least), it's not automatic, and you
need to open the library database explicitly to access its resources. (Maybe
different versions of the OS handled it differently?)

However, just hoping that you don't collide with the application's resources
seems like a really bad idea.

I don't think it's a good practice for a library to open its database and to
leave to open when returning to the caller.  If you do so, at the very least
make sure whatever resources your library has are /well-documented/ so that the
caller can avoid them.

If you're going to present a dialog, I'd think that better approaches would be:

A. in your library function, the library opens its own database, gets/locks its
resources, runs its dialog code, releases/unlocks its resources, and closes its
database before returning to the caller

B. add a 'code' 1 resource to your library as if it were a normal application. 
In your library function, call SysAppLaunch on your library and present the
dialog in PilotMain.

(To be honest, I haven't written any shared libraries yet that have their own
resources, so the two ideas above are theoretical.  I don't see why they
wouldn't work, though...)

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

Reply via email to