>When I try to build my existing code, after making the documented changes to
>use PalmOS.h and PalmCompatibility.h, I found that the WinSetForeColor()
>function
>had changed its parameters. If I modify my program to use the new SDK 3.5
>prototype,
>it crashes on non-3.5 devices.
>
>Reading the ColorDeal example, it uses WinSetColors() to select grey colours
>on OS 3.0 to 3.3. However, this function is not documented anywhere in the 3.5
>SDK documentation, even under the "Compatibility" section.
>
>Questions: Where is the description of the WinSetColors() function? Why did
>the WinSetForeColor syntax change, and why doesn't it work across platforms?
You're right, it did change. I can explain what you should do in response,
but not necessarily defend why it happened :-)
Prior to 3.5, WinSetForeColor and WinSetBackColor were just very simple
macros that expanded to a call to WinSetColors. The behavior of
WinSetColors didn't change in 3.5, but the meaning of those macros in the
3.5 SDK did.
So the right thing for you to do, if you're using the new SDK, is mimic
ColorDeal and call WinSetColors if you're on <3.5. The old macro makes it
darn trivial to figure out how it works :-)
You could always call WinSetColors on any OS version and the right thing
would happen, but if you're on 3.5 or higher using the real WinSetForeColor
will be considerably more efficient.
-David Fedor
Palm Developer Support
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/