You also have to have the library open up it's own database on it's first
time starting, and closing DB on exit. What you have to be very careful, is
that you do not know which was the last DB opened, since the library may
have been opened before current application, therefore you might end up
getting the wrong resource. As for the idea of using resources above 9000, I
wouldn't suggest it with shared libraries, because future developers might
not do that. Also some compilers start AUTOID from 9999 and go down. I used
resources in the 7000's which are less common, but I would really suggest
trying is always using DmFindResource(), in your library, to open resources,
so you can specify the Database. I haven't tried it yet myself. Also this
doesn't solve the application using the library's resources. So be careful.
LionScribe



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Matthew
Darkstorm Bevan
Sent: Monday, September 15, 2003 7:50 PM
To: Palm Developer Forum
Subject: Re: Shared libraries with resources : is it possible?


Yes, and yes.  My Common/UI library does exactly this to provide
standard about dialogs, VFS open and save dialogs, help display, and
more.  The library even includes application icons for itself.  You have
to worry about mapping over someone else's resource IDs (ID
collisions) - having two forms with the same ID is just asking for it.

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!

--
Matthew (Darkstorm) Bevan       [EMAIL PROTECTED]
Margin Software, NECTI.  http://www.marginsoftware.com
 Re-inventing the wheel, every time.



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



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

Reply via email to