At 02:15 PM 5/4/99 -0700, you wrote:
>There are various thing you can do to reduce the global nature of your
>application, but these are basically "point of reference" methods - you
>could put your info in a Database (yes, just another global, but even worse
>- other applications can get at it).  You could have just one global, which
>does reduce the problem but does not eliminate it.  You could try and
>subclass the FormType for all your forms, but I suspect that you would be
>asking for trouble.  And really useful method of solving your "global"
>problem is to ignore it.
>

We use gadget's to store form-specific information.  It works like this:

When the form initializes, we allocate a handle large enough to hold the
form specific data.  We store this in the gadget using FrmSetGadgetData().

For subsequent calls, we retrieve this data using FrmGetGadgetData().

When the form closes, we free the memory and set the gadget data to NULL.

I don't know what implications there are to this, other than a bit of
performance penalty for having to retrieve the gadget data so much and a
memory penalty for the extra gadget per form.  Still, I think this provides
the cleanest approach.

Any other ideas?

Regards,
Greg

Greg Winton
Bachmann Software and Services, LLC
http://www.bachmannsoftware.com
Software Development for Handheld & Mobile Computing, Windows and the Internet
Home of Bachmann Print Manager, the only graphical printing solution for
the Palm Computing Platform

Reply via email to