[comp.sys.apple] TaskMasterDA?

q4kx@vax5.cit.cornell.edu (Joel Sumner) (02/15/90)

Could someone please give me some information on TaskMasterDA?  Better
yet, could someone please send me some example source code?  (Pascal or
C is much preferred).  I have the ToolBox Ref III from ADPA and for the
life of me I can't figure out if the TaskMasterDA call goes in a DA or
in an Application that supports DA's.  It seems like it should go in a DA
but I have no idea where!  Since the routine DAAction gets called with
input the Code parameter, it seems silly to make the call
    code:=TaskMasterDA(Mask,TaskRecPtr);

I must admit that I have the Beta Draft of ToolBox Ref III but here is what it
says for TaskMasterDA......

"This call is the TaskMaster entry point for Desk Accessories.  Your program
passes event information obtained from the Desk Manager"

Well, frankly, I don't have any idea what the heck they are talking about.

I really wish Apple would include some notes on usage of tools somewhere.  I
am using TML Pascal II and I have the example disk but their Example NDA
doesn't use TaskmasterDA.  Please help me!

Joel Sumner        | Bitnet: Q4KX@CORNELLA
GENIE: JOEL.SUMNER | Internet: q4kx@cornella.ccs.cornell.edu
-------------------| Here: q4kx@vax5.cit.cornell.edu
Assumption is the mother of all screw-ups.  

dlyons@Apple.COM (David A. Lyons) (02/15/90)

In article <3458.25d99a88@vax5.cit.cornell.edu> q4kx@vax5.cit.cornell.edu (Joel Sumner) writes:
>Could someone please give me some information on TaskMasterDA?
>[...]  It seems like it should go in a DA
>but I have no idea where!  Since the routine DAAction gets called with
>input the Code parameter, it seems silly to make the call
>    code:=TaskMasterDA(Mask,TaskRecPtr);

When the Desk Manager calls your DA's DAAction procedure with the code
"eventAction", it gives you a pointer to an event record.  You need to
copy that event record into an extended task record (which is bigger),
zero out the additional fields, and call TaskMasterDA with a dummy event
mask and a pointer to your extended task record.  Remember to fill in
the wmTaskMask field of the extended task record to tell TaskMasterDA
what kinds of tasks you want it to do for you.

Do *not* feed TaskMasterDA the same pointer the Desk Manager gave you--
it you do, you'll wind up trashing memory past the end of that, since
it is only guaranteed to have the event record fields.
-- 
David A. Lyons, Apple Computer, Inc.      |   DAL Systems
Apple II Developer Technical Support      |   P.O. Box 875
America Online: Dave Lyons                |   Cupertino, CA 95015-0875
GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons
   
My opinions are my own, not Apple's.