[comp.sys.mac.programmer] SetUpA4

ar4@sage.cc.purdue.edu (Piper Keairnes) (03/18/90)

    Well, I've just converted one of my applications into a DA. All has
gone well except what to do for the SetUpA4() and RestoreA4(). I'm working
with ThinkC 4.0 and using the "DA Main.c" code as instructed so the DA works
fine when run under the ThinkC environment.

    BUT, when I remove the "DA Main.c" file from my project, rename the
"_main" back to "main", compile the project as a desk accessory and then
run it....
		LA BOMBA !!

    So, I placed the SetUpA4() and RestoreA4() pair inside of two functions:
doControl and doClose.  Still bombed...

    I apparently don't understand the complete concept and need more of a
guideline to go on than some sketchy reading...

    Could someone please help....

--Piper

siegel@endor.harvard.edu (Rich Siegel) (03/20/90)

In article <3819@sage.cc.purdue.edu> ar4@sage.cc.purdue.edu (Piper Keairnes) writes:
>
>    Well, I've just converted one of my applications into a DA. All has
>gone well except what to do for the SetUpA4() and RestoreA4(). I'm working
>with ThinkC 4.0 and using the "DA Main.c" code as instructed so the DA works
>fine when run under the ThinkC environment.
>
>    BUT, when I remove the "DA Main.c" file from my project, rename the
>"_main" back to "main", compile the project as a desk accessory and then
>run it....
>		LA BOMBA !!
>
>    So, I placed the SetUpA4() and RestoreA4() pair inside of two functions:
>doControl and doClose.  Still bombed...

	If your DA is multiple-segmented, or uses globals, then SetupA4()
and RestoreA4() should be used at the beginning and end of main() itself.

R.
~~~~~~~~~~~~~~~
 Rich Siegel
 Staff Software Developer
 Symantec Corporation, Language Products Group
 Internet: siegel@endor.harvard.edu
 UUCP: ..harvard!endor!siegel

"When someone who makes four hundred and fifty dollars an hour wants to
tell you something for free, it's a good idea to listen."

~~~~~~~~~~~~~~~

bjb@pyramid.com (Bruce Beare) (03/20/90)

In article <3819@sage.cc.purdue.edu> ar4@sage.cc.purdue.edu (Piper 
Keairnes) writes:
> cc.purdue.edu!ar4
> 
>     Well, I've just converted one of my applications into a DA. All has
> gone well except what to do for the SetUpA4() and RestoreA4(). I'm 
working
> with ThinkC 4.0 and using the "DA Main.c" code as instructed so the DA 
works
> fine when run under the ThinkC environment.
> 
>     BUT, when I remove the "DA Main.c" file from my project, rename the
> "_main" back to "main", compile the project as a desk accessory and then
> run it....
>                 LA BOMBA !!
> 
>     So, I placed the SetUpA4() and RestoreA4() pair inside of two 
functions:
> doControl and doClose.  Still bombed...
> 

You may also have other problems -- not related to A4, etc. For instance, 
DAs require a
rather particular numbering sequence for any resources that they need. See 
IM (I don't
remember chapter and verse).

-Bruce