Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!netcom!avery From: avery@netcom.UUCP (Avery Colter) Newsgroups: comp.sys.apple2 Subject: Re: Q: Orca/C and SFMultiGet2 Message-ID: <18830@netcom.UUCP> Date: 15 Dec 90 05:14:39 GMT References: <1198@dg.dg.com> Organization: Netcom- The Bay Area's Public Access Unix System {408 241-9760 guest} Lines: 36 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 >namesHandle structure is a handle to another structure; bufferLength (word) >and fileEntryArray. Im not that comfortable w/handles yet and so would >appreciate any pointers (no pun intended?) on how I would dereference the >handle namesHandle so that I can access the file array. Some short sample >could might also be helpful... 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 dereference. In other words, I'm not completely sure, but this might be treated as an array of arrays, i.e., you would do an expression like namesHandle[fileNumber][fileAttribute]. Or, wait. fileEntryArray is the second element of a structure. OK, so to get a pointer to a particular file's entry structure, you would evaluate (namesHandle->fileEntryArray)[fileEntry] and to see a particlar attribute, you would use... (namesHandle->fileEntryArray)[fileEntry].fileType for instance. Is this right? Or should namesHanlde be dereffed? -- Avery Ray Colter {apple|claris}!netcom!avery {decwrl|mips|sgi}!btr!elfcat (415) 839-4567 "I feel love has got to come on and I want it: Something big and lovely!" - The B-52s, "Channel Z"