<v04210102b3ccd18eed6-@[207.135.95.28]> wrote:
original
article:http://www.egroups.com/group/palm-dev-forum/?start=14790
> At 10:45 AM -0700 8/2/99, Kevin O'Keefe wrote:
> >Also, all code that is needed to process launch codes must be in
> >the first segment.
>
> The first segment must contain all the code needed to process all
launch codes except:
>
> - Normal launch
> - Goto launch (sub-launch or new globals)
> - All sub-launches where you have access to globals
>
> This means that AppStart and AppStop don't need to be in the first
segment, but Search typically needs to be in the first segment because
the find launch may not be a sub-launch. If you forget to put a routine
in the first segment, any attempt to call it when handling a launch code
other than one of those mentioned above will crash. I split each of my
.c files into Seg1 and SegN parts.
>
> Be sure to put the resources in the last segment. Calls to routines
placed after the resources seem to fail.
>
> If you follow the instructions for multi-segment projects from
Metrowerks, you'll be including a fairly big library in your code. This
provides 64 bit integer math, for example. If you don't need any of this
stuff, you can create your own multi-segment library fairly easily.
>
> I found it particularly difficult to debug code that runs on a reset
launch code, so I advise keeping this code to a minimum. It's probably
better to delay the real work until the next launch anyway since crashes
during reset are frustrating for users who don't know about the "up"
button reset.
>
> Hope this helps.
> -
> Danny Epstein     *     mailto:[EMAIL PROTECTED]
> Applied Thought Corporation     *     http://www.appliedthought.com
> Flytrap for PalmOS     *     http://www.appliedthought.com/flytrap
>
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.

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)?

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

Thanks in advance for answering my questions.

Reply via email to