I just found out that the problem I was having wasn't with typedef's or
functions at all:

> below didn't compile:
> 
> typedef bool (*PJEventCallback_t)(EventType* pEvent);

I was completely fooled because:

- the Metrowerks  syntax coloring identified bool, true, and false as
blue
- the headers (at least OS3.1)  defined true and false and bool
- I was using C++ notations everywhere successfully

But what I caught finally was that my syntax problem was simply from
using the type "bool" , and that in reality, "true" and "false" were not
defined!

(I'd been using "true" and "false" all this time not realizing that they
were just garbage ints!)

Everything compiled when I included:

typedef unsigned char bool;
enum { false = 0, true = 1 };

So then it dawned on me and I went under the C++ setting and found that 
the "enable bool" option defaults to off.

So there you have it - in just 5 hours I solved the problem myself*.
But thanks for listening.  :)

- Jeff

*For those about to flame me to oblivion, remember it's hard to tell
ahead of time whether or not a problem solution is simple or
complicated...  I would never have suspected bools would be turned off. 
:)

DIAMOND JEFF wrote:
> 
> 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/

Reply via email to