I know this topic has been already discussed a lot of time...
Since i don't like to have globals in my programs, i was thinking
how to avoid them.
When i use FrmInitForm, a new Form handle is created.
I could then create another handle of the size of the returned one
plus my globals structure. Using this new handle should
allow me to have my globals when i need them.
Would such a tecnique work? What are the risks involved?
Any other better solution?
In an OS i'm familiar with, an handler is declares as follows:
struct Hook
{
struct MinNode h_MinNode;
ULONG (*h_Entry)(); /* assembler entry point */
ULONG (*h_SubEntry)(); /* often HLL entry point */
APTR h_Data; /* owner specific */
};
the h_Data is used to pass pointers around... i hope that a future PalmOS
revision will have something similar implemented.
--
- alex.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/