Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!usc!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Getting an appl. and its doc's to relate... Message-ID: <9495@goofy.Apple.COM> Date: 31 Jul 90 00:27:49 GMT References: <1990Jul30.172925.11682@Neon.Stanford.EDU> Distribution: usa Organization: Apple Computer Inc., Cupertino, CA Lines: 47 In article <1990Jul30.172925.11682@Neon.Stanford.EDU> Peter Commons writes: >Can anyone tell me what I need to do so that the following two app/doc >relations will work? > >1) So that if I do "get info" on a document for my application, it will say >"An document". The document's type and creator must be setup correctly. For example, if your app's type and creator are "APPL" and "MYAP" respectively, your document would have to have a type and creator of "ADOC" and "MYAP", i.e., the creators need to match. Also, as far as required resources go, you'll need the following: BNDL 128 creator="MYAP" and includes references to: - "ICN#" 128 (app's icon) - "ICN#" 129 (doc's icon) - "FREF" 128 (app's file ref) - "FREF" 129 (doc's file ref) FREF 128 type="APPL", localID=0, filename="" FREF 129 type="ADOC", localID=1, filename="" ICN# 128 (app's icon) ICN# 129 (doc's icon) >2) So that if I double click on the document, it will run my application and >"open" the document. If Get Info thinks that the document belongs to your application, then it will run your app and pass some info to it regarding the file name, etc. All the specifics about this can be found in the Segment Loader chapter of Inside Mac, volume 2. Specifically see CountAppFiles(), GetAppFiles(), and ClrAppFiles(). steve -- ____________________________________________________________________ Steve Christensen Internet: stevec@goofy.apple.com Apple Computer, Inc. AppleLink: STEVEC 20525 Mariani Ave, MS 81-CS CompuServe: 76174,1712 Cupertino, CA 95014 "You just contradicted me." "No I didn't." ____________________________________________________________________