I tap on the "Application" button to exit my application without going through "normal" shutdown procedures. This works fine on all defined "real" (ie: Constructor built) forms. When I have a dynamically defined form popped up over a "real" one, tapping on the "Application" button causes "FrmCloseAllForms" to send a "frmCloseEvent" to each of my active forms (as it should). Note that the calling form is still open and will also get a "frmCloseEvent" My frmCloseEvent routine has to free all the allocated memory that is usually freed when I exit the form "normally" (after tapping "OK"). The pointers to that memory are in a Global area in the popped up form's program global area. Unfortunately, the "global access" is shut off by the tapping of the Application button, so I get a nasty warning from the Emulator that I have accessed Globals when they're not accessible. Message: "<my application and version> has just tried to access a global variable at a time when global variable access is not allowed. Typically means that the application tried to access the global variable after PilotMain was called with a launch code other than "sysAppLaunchCmdNormalLaunch". The last code observed by the emulator was "sysAppLaunchCmdNormalLaunch". So, how am I supposed to free my allocated memory if I can't access the global where its address is stored? For the time being, I have defined a "gadget" and placed it on the form, then stored the address of an allocated area where I store the globals that used to be in the program global area. Is this really a problem, or just the emulator being over-protective? This *might* have something to do with the fact that I didn't "load" the form. I built it dynamically. Has anybody else run into this particular situation? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
