"Ben Combee" <[EMAIL PROTECTED]> wrote in message
news:92443@palm-dev-forum...
> The big one is that if you want to open additional forms, you need to
> DmOpenDatabase on your hack database before trying to open anything
> else, so your hack opens your own form, and not the form of the running
> application.  Be sure to DmCloseDatabase when you're done.
> --

Thanks, Ben! (and sorry to repeat this message to you - I accidentally sent
my original reply to your e-mail rather than the forum)

This worked like a charm - my hack is working fine with all the onboard Palm
apps I'm testing it against.

In a separate post (see "Forms in Hack Was: Re: Target Settings for Hack?"),
Andreas Linke expressed concerns about possible UI conflicts with the
running app.  I repeat FYI, along with my response.  Any comments would be
appreciated!

> "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 -

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/

Reply via email to