kkscat1 wrote:screenH = WinGetDrawWindow(); err = FtrGet( sysFtrCreator, sysFtrNumWinVersion, &winVersion ); if(winVersion >= 4) { WinGetDrawWindowBounds(&windowBounds); } else { WinGetBounds(global_bitmapWinH, &windowBounds); } there is no problem In Palm Emulator(OS 4.0 or later). But Palm Emulator(OS 3.5 or prior to OS 4.0) reports error: error occur:"A(1.0) called Palm OS routine #0xA456(WinGetBounds).This routine does not exist in this version of the Palm OS.". Do somebody knows how to use function of WinGetBounds in Palm OS prior to 4.0.
from Palm OS 5 docs: "Prior to Palm OS 4.0, WinGetBounds returned the bounds of the draw window, and did not take a window handle as an argument."
If I'm understanding correctly, because the arguments are different, you can't call this function unless you are using the header file from before OS 4.0. Can that be correct?
This is a sad chapter in the history of Palm OS.
Every Palm OS system function corresponds to a trap number. Trap number 0xA228 has evidently been in Palm OS since version 1.0. Before version 4.0, the name of the function that called this trap was WinGetBounds. As of 4.0, the name of the function that called this trap was changed to WinGetDrawWindowBounds, and the old name, WinGetBounds, was *reused* as the name for a new trap, 0xA456 (with different arguments, fortunately).
The new nomenclature makes more sense than the old: system functions that include the phrase "DrawWindow" implicitly refer to the current draw window, and window functions that don't include that phrase take a window handle as an argument, i.e., they refer to some specified window. The old WinGetBounds was an anomaly, in that it referred implictly to the current draw window, but its name didn't include the phrase "DrawWindow".
Great, we all like consistent and predictable nomenclature ... but we also like compatibility! I frankly don't know how they got away with this (and maybe a Palm OS expert will tell us): evidently the source of every Palm OS application that used the function WinGetBounds prior to 4.0 had to be modified, either replacing it with WinGetDrawWindowBounds, or changing the code to make use of new system functions. I always thought this was the ultimate no-no, but what do I know -- I learned system programming in prehistoric times (Univac 1108, circa 1970).
Greg Lutz
NearSpace, Inc.
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
