Qun Wang wrote:
>I am Sorry, but you confused me. according to Metrowerks' Targetting
>Palm OS Doc, the following has to be in the first segment.
>* MSL Runtime Palm OS (4i).lib if the 4-Byte Ints option is selected in
>the 68K Processor panel or
>* MSL Runtime Palm OS (2i).lib if the 4-Byte Ints option is deselected
>in the 68K Processor panel
>* PilotMain() (or the file containing PilotMain())
>* any other routines that PilotMain() calls when it receives a
>sysAppLaunchCmdNormalLaunch command.

Scott Johnson spelled this out nicely:
>Note that there is an error in the Metrowerks Targeting book.  The 4th
>point on page PAL-24 is backwards: it should say Segment 1 must contain
>all code called from launch codes _other_than_ normal launch.  (And
>strictly speaking, that's not quite right either.  Segment 1 must
>contain all code called from launch codes that don't have global
>variables.  But saying "normal launch" is usually close enough.)

Qun Wang wrote:
>So AppStart and AppStop are called in the sysAppLaunchCmdNormalLaunch,
>they have to be in first segment. right?
>What about the methods that AppStart, AppStop, and AppEventLoop calls
>and the methods in AppHandleEvent(those Event handlers)?

All of these routines can be in any segment because they're only used on normal launch 
and other launch codes where you have access to globals.

>Another question is can the methods in the second segment use Global
>Variables?

No. All routines which access globals must be in the first segment.
-
Danny Epstein     *     mailto:[EMAIL PROTECTED]
Applied Thought Corporation     *     http://www.appliedthought.com
Flytrap for PalmOS     *     http://www.appliedthought.com/flytrap

Reply via email to