At 6:39 PM -0700 5/10/99, Mark Campillo wrote:
>Boolean (*oldTrap)(FieldPtr, EventPtr);
>  //handled = oldTrap(fld, event); <-- This seems to be the problem line

Well, honestly the pointer-to-function declaration syntax has always
confused me, which is why I prefer typedefs, but I think it's the source of
your problem.  The variable oldTrap in this case is a pointer to a
function, so you need to dereference it in order to call it.

That is, your line should be:
        handled = (*oldTrap)(fld, event)

It would probably be clearer if you did something like this:

        // create the type
        typedef Boolean FldHandleEventFunction(FieldPtr, EventPtr);

        // declare the variable -- explicitly a pointer to a function
        FldHandleEventFunction *oldTrapP;

        // get the value
        FtrGet(myCreator, myResID, &oldTrapP);

        // call the function
        handled = (*oldTrapP)(fld, event)


                        --Bob


Reply via email to