When your Trap function is called you are going to get the same stack
frame as the original function.  I don't know of any way to have an
additional parameter forced on the stack.

Regarding #2, a lot of programmers seem to store this type of stuff as
"Features".  IE, you store the old trap address as a feature with your
creator ID and then retrieve it using the feature manager when you need
it.

Best Regards,
-jjf

-----Original Message-----
From: shay [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 15, 2000 9:37 AM
To: Palm Developer Forum
Subject: trap in shared library


hi,
i need to take a TRAP to something and release it from a shared library
(!)

for an example - i manage to trap the "SysDelayTask" (do a delay),
and whenever an application trying to do a delay,
my trap function is loaded.

i have two questions :

1. i used : SysSetTrapAddress (sysTrapSysTaskDelay,MyTrapFunc);
can i pass any parameter to the function ?

2. in the trap function i need to call :
  SysSetTrapAddress (sysTrapSysTaskDelay,(OldTrapAddr));
BUT - the OldTrapAddr is a global variable,
and in shared library i can't use globals.
so i thought to use the method explained in articles
about the handle that holds the struct of globals,
but for that i need to pass a variable of the "RefNum" of the library
loaded,
that is question #1.

So how can i do it (release a trap) from a shared library ?

by the way - no one answered a previous question of mine
about "specific trap", please take a look.

Thanks

shay






-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to