Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!alberta!edson!news From: jpenne@ee.ualberta.ca (Jerry Penner) Newsgroups: comp.sys.apple2 Subject: Handle Dereferencing (was Re: Q: Orca/C and SFMultiGet2) Message-ID: <1990Dec15.080751.20819@ee.ualberta.ca> Date: 15 Dec 90 08:07:51 GMT References: <1198@dg.dg.com> <18830@netcom.UUCP> Sender: news@ee.ualberta.ca Organization: University of Alberta Electrical Engineering Lines: 44 In article <18830@netcom.UUCP> avery@netcom.UUCP (Avery Colter) writes: >bkahn@archive.webo.dg.com (Bruce Kahn) writes: > >> Im trying to change a program I have that uses SFGetFile to use SFMultiGet2 >>and am a bit stumped on something. The value I get back from SFMultiGet2 is >>a structure that has 2 fields, good (boolean) and namesHandle (Handle). The [stuff deleted] >Ahhhh, lesseee, here it is in vol 3 of the Toolbox Ref [anyone who wants >to sell me volume 1 can mail me anytime!]. > >I believe a handle is a pointer to a pointer, or more precisely, a pointer >to an array of pointers. I believe this problem would be to do a double Not a pointer to an array of pointers. Just a pointer to a pointer. > [some examples deleted] >Avery Ray Colter {apple|claris}!netcom!avery {decwrl|mips|sgi}!btr!elfcat To dereference a handle, just do: **handleName In assembler, it's a tad more complex: dpLoc = some direct page location (4 bytes) lda [handle] sta dpLoc ldy #2 lda [handle],y sta dpLoc+2 now just get info out of dpLoc using regular indirection. NOTE: You should lock the handle if you intend to make any toolcalls between the time you dereferenced the handle and when you access stuff from the dereferenced pointer 'dpLoc'. -- ------------- Jerry Penner alberta!bode!jpenne Edmonton, Alberta, Canada