Hi all-

Sorry for what some will call a newby question.  I guess if I were a
better c programmer, I'd know how to do this.  :-)

I'm trying to patch a system trap with the following:

UInt32 oldTrap;

static void myPrgUpdateDialog (ProgressPtr prgP, UInt16 err, UInt16 stage,
        Char *messageP, Boolean updateNow);
static void myPrgUpdateDialog (ProgressPtr prgP, UInt16 err, UInt16 stage, 
        Char *messageP, Boolean updateNow) {
        if (err) err = 0;
        // how to call oldTrap with vars?
        PrgUpdateDialog(prgP, err, stage, messageP, updateNow);
        }

void MainForm::BeamMeSilent() {
        oldTrap = *(UInt32*)SysGetTrapAddress(sysTrapPrgUpdateDialog);
        Err error = SysSetTrapAddress(sysTrapPrgHandleEvent, myPrgUpdateDialog);
        PDatabase me(NULL, 'appl', Creator(), false);
        me.Beam();
        error = SysSetTrapAddress(sysTrapPrgHandleEvent, oldTrap);
        }

of course the call to PgrUpdateDialog within myPrgUpdateDialog will
just cause an infinite loop.  I've got the address of the old trap in
oldTrap, how do I push all my variables on the stack and then
execute at that oldTrap address?

Thanks,
Ted
[EMAIL PROTECTED]


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

Reply via email to