Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!ssc-vax!uvicctr.UVic.CA!marykuca From: marykuca@uvicctr.UVic.CA.UUCP (Brent Marykuca) Newsgroups: comp.sys.mac.programmer Subject: Re: CDEV/INIT Data Exchange, another way Summary: Why not use Gestalt? Message-ID: <1121@uvicctr.UVic.CA.UUCP> Date: 7 Jun 90 20:05:55 GMT References: <55045@microsoft.UUCP> <1990Jun5.142604.11826@asterix.drev.dnd.ca> <8560@goofy.Apple.COM> <1990Jun6.163604.12918@murdoch.acc.Virginia.EDU> Reply-To: marykuca@uvicctr.UVic.CA.UUCP (Brent Marykuca) Organization: University of Victoria, Victoria B.C. Canada Lines: 21 It seems to me that all this kludgy-sounding passing around of resources and testing for "magic strings" can be eliminated fairly easily by using the Gestalt Manager, which can be found in all Macintosh systems after 6.0.4, and in glue form in MPW 3.2. Have the INIT use NewGestalt to install a new Gestalt selector function which returns a pointer (or handle, or whatever is required) to the data to be exchanged. Then have the cdev call Gestalt to pick up the handle. If the INIT hasn't been loaded, then Gestalt will return an error. This seems clean (no prefs file cluttering up your System Folder, no validity checking to do on the resource if it is there) and compatible. About the only thing that I can see that is wrong with this approach (and if I've missed anything, I'm certain that somebody will point it out) is that Gestalt is supposed to be used for feature testing, not as a mailbox for data. Cheers, Brent Marykuca Computing User Services University of Victoria