Jim and everyone else, I suspected that the my
replacement for the trap was probably being unloaded
from memory, however I am not sure if that is entirely
true..... 

Now I might be mistaken but, I just got my code to
work now (I had a slight problem - in that I was
really hammering away at the keyqueue and that's what
was causing the crash. I have since fixed that
problem.)

I don't have the code handy but Monday I will post
what "seems" t work and would appreciate any comments
on why this works. As based on your's and everyone
elses comments it should not work.

Thanks again for all the info, it's been really
helpful.

Jay
--- Jim Schram <[EMAIL PROTECTED]> wrote:
> At 12:55 AM +0100 2001/07/07, Igor Mozolevsky wrote:
> >So, how does one get the OS not to unload the code
> for a particular function when the app quits?
> 
> You don't. And you don't leave traps patched after
> your application exits.
> 
> However, there are several methods available to work
> around this. For example, copy the patch routine(s)
> into an allocated [dynamic heap or feature] pointer
> so that neither the code nor the allocated memory
> block is part of your application. Better yet, write
> a system extension (not documented, sorry) which
> loads during the boot sequence and permanently
> patches the trap (like System Updates do).
> 
> The latter is the best way to avoid problems without
> using a patch chain manager such as Hackmaster. To
> understand why, you merely need to think through the
> following [extremely common] situation: A and B are
> patches to the same trap. A is applied first. Then B
> is applied. Then A is removed. The trap can no
> longer be called without crashing. Hackmaster (et
> al.) remap the patch chain to avoid this situation.
> This is why patching should *only* be done using one
> of the third-party trap managers.
> 
> Regards,
> 
> Jim Schram
> Palm Incorporated
> Partner Engineering
> 
> 
> -- 
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/


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

Reply via email to