How I've done it (from an earlier post):
in you header:
typedef void MyFunctionCallback
(VarType MyVar);
typedef MyFunctionCallbackPtr * MyFunctionCallback
In your local code define the function to call:
void MyLocalFunctionThatWillBeCalledBack(VarType);
static void MyLocalFunctionThatWillBeCalledBack(VarType MyVar)
{
// Code
// Code
}
How to make the call:
(void) (PtrToMyLocalFunctionThatWillBeCalledBack)(MyVar);
You can replace the return type and the function arguments with whatever you
need.
----- Original Message -----
From: "Kevin O'Keefe" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[email protected]>
Sent: Tuesday, September 05, 2000 12:44 PM
Subject: RE: How to use function pointers in metrowerks?
> I'm guessing it's not compiling because you tried to use 'bool', the
correct
> PalmOS type is 'Boolean'.
>
> Kevin
>
> > -----Original Message-----
> > From: DIAMOND JEFF [mailto:[EMAIL PROTECTED]
> > Sent: Friday, August 11, 2000 1:05 PM
> > To: Palm Developer Forum
> > Subject: How to use function pointers in metrowerks?
> >
> >
> > This seems like somthing that should be somewhere in the codewarrior
> > documentation, but I can't find it...
> >
> > I have two questions:
> >
> > (1) In a Palm project, can you store function pointers to another
> > function which may lie in a different segment?
> >
> > (2) What syntax do you use to define a function pointer? The notation
> > below didn't compile:
> >
> > typedef bool (*PJEventCallback_t)(EventType* pEvent);
> >
> > Much appreciated!
> > - Jeff
> >
> > --
> > 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/
>
>
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/