>That is fine and dandy but what does that mean in terms of performance or
>resource availability.

It means that if there's another database opened up after your app's, then
DmGet1Resource wouldn't find the resource if it is just in your app's db.

To summarize what happens in the code of each function: DmGet1Resource only
searches in the most recently opened.  DmGetResource is a loop, searching
from the most recently opened DBs to the ones opened longest ago.  If a
given resource is found in the most recently opened DB, the two functions
should be practically identical in performance.

If you know that the resource exists, and you're not doing something
special like a resource editing app, and you just want to read it then I'd
say in nearly every case you'd be safer with the general DmGetResource
style.  That way you're not introducing a dependency on not having some
other part of your app (or hack or Overlay or whatever) open a resource
database and thus break this code.  (Overlays are special, though, so Get1
can actually search two databases in some circumstances.)

And if you want to be really sure the resource only comes from a
specifically chosen database, and don't want to have to worry about whether
some other bit of your code might have opened up another db, then you could
always use DmFindResource - it takes the database reference as a parameter
so there's no ambiguity possible.

-David Fedor
Palm Developer Support



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to