Although, it appears DmGetResource searches resources in order from last
opened, since DmOpenDatabase (in prior OS releases) and DmOpenDBNoOverlay
link in the last opened db as first in the search chain, and DmGet1Resource
reads only the first DB in the search chain.  So, as long as my DB opened
correctly, I should be fine.  Or, am I missing something?

"Kevin OKeefe" <[EMAIL PROTECTED]> wrote in message
news:92666@palm-dev-forum...

If you put your hack's resources into a resource database that you open when
your hack is running and then use DmGet1Resource calls (that search the most
recent resource database for things), then you can pretty safely use
whatever IDs you want for things.

The only problem might be calling APIs that don't use DmGet1Resource, so you
may have to do some things yourself as opposed to calling APIs.  For
instance, FrmInitForm calls ResLoadForm, which calls DmGetResource (Why not
DmGet1Resource here???), so in this case, you might get the application's
form instead of your hack's form.

Kevin

-----Original Message-----
From: Geoff Thompson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 30, 2002 5:54 PM
To: Palm Developer Forum
Subject: Re: Forms in hacks Was: Re: Target Settings for Hack?



"Linke, Andreas" <[EMAIL PROTECTED]> wrote in message
news:92452@palm-dev-forum...

> Keep in mind that your code runs in the currently active application, just
as if it were a part of it. Every form id you use in your hack may already
be loaded in the active app. This makes displaying your own form resources
from a running hack pretty difficult, if not impossible.
>
> One solution (see the McPhling source for an example) would be to
dynamically create the form and controls at runtime. Unfortunately, all
dynamic control creation calls are thoroughly broken in all OS versions
below 4.0 so you can only use FrmNewForm, CtlNewControl etc. on devices with
PalmOS 4.0+.
>
> Unless you have a very good reason to display your own forms in your hack,
and you have a very good understanding of what's actually going on there, my
suggestion would be to refrain from displaying any UIs from your hack.
>

Thanks, Andreas, (and sorry - I accidentally sent my original reply to this
post to your e-mail rather than the forum - so to you this will be a
repeat)...

After following Ben Combee's advice (see Re: Traget Settings for Hack?), I
got my hack working, and in testing it appears to run fine with at least the
pre-installed Palm apps.  I am worried, however, about having UI resources
in the hack that could conflict with the calling app.  As I want the app to
run on 3.1 and above, dynamically generating UI, as you suggest here for
4.0+, doesn't sound like a valid alternative.

My hack is a modal dialog that loads its resource DB, intializes the form in
question via FrmInitForm, and then takes control of the event loop within
the hack code resource.  Once the user finishes with the dialog, the
function erases the form, unloads the DB and returns control to the calling
form/app.

So:

1).  Does FrmInitForm look for resources in a particular order (like most
recently opened DB first)?  If so, I shouldn't have a problem.  If not -

2).  Is there another way to intialize a form, where I can specify the
resource DB to use?

3).  Is there a range of UI IDs that would be safe (not likely, I would
guess)?

    - or -

4).  Are there dynamic alternatives for older OSes (keeping in mind that my
form has field, button and gadget resources on it)?

Thanks!

Geoff




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


------------------------------------------

The information in this transmittal and any attachments is privileged and
confidential and is intended only for the recipient(s) listed above. You are
hereby notified that any unauthorized distribution or copying of this
transmittal or its attachments is prohibited. If you have received this
transmittal in error, please notify Invivodata immediately at (831)
438-9550.

------------------------------------------







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

Reply via email to