Path: utzoo!attcan!uunet!munnari.oz.au!uniwa!vax7!nlewispn From: Lewis_P@cc.curtin.edu.au (Peter Lewis) Newsgroups: comp.sys.mac.programmer Subject: Re: Modifying Inits Message-ID: <4486.273fb940@cc.curtin.edu.au> Date: 13 Nov 90 01:13:36 GMT References: <2351.2737EA8E@blkcat.fidonet.org> <15669@reed.UUCP> Organization: Curtin University of Technology Lines: 54 In article <15669@reed.UUCP>, chaffee@reed.UUCP (Alex Chaffee) writes: > In <2351.2737EA8E@blkcat.fidonet.org> Ken.Knight@f421.n109.z1.fidonet.org (Ken Knight) writes: > >> [CDEV/INIT IPC Question] > > This is one of those great undocumented problems with no clean solution. > It's basically unsafe to save the data in the init file itself, since users > have a habit of renaming inits and it'd be hard to find your data if you did > that. So put it in a preferences file in the system folder (or, better yet, > in the preferences folder). That way both the INIT and the cdev will know > exactly where to find it. It doesnt matter if the user renames the INIT, both the INIT and the CDEV have direct access to the resource file (The INIT has a handle to itself in A0, and the cdev is called with CurResFile set to the file (I think CurResFile is valid for the INIT as well)). So as long as you dont mind waiting til Restart time, this is the best method for communicating between INIT/CDEV (IMHO). (Please - not another file in my system folder!!!) If you wish immediate communication, the only sane way is to use _Gestalt, but this requires having an current system which many people do not have yet. (I wonder what happens if you search thru virtual memory looking for a signiture?). On the subject of _Gestalt, I've seen no docs yet but I understand that there is a call to a mapping from a signiture to a longInt, and a call to return the longInt given the signiture. If this is correct, the two more calls would allow hierarchical information - SetGestaultX(which_gestault:handle; signiture:longInt; value:longInt); GetGestaultX(which_gestault:handle; signiture:longInt; var value:longInt); (So you could create your own Gestaul mapping, and save the handle to them in the system Gestault mapping). It seems to me this could be a very powerful feature. Does Apple already do something like this? OK, I've finished my ramblings now, unless no one has mentioned the CDEV/INIT-IPC package that is I think available on info-mac et al which is suppose to be very good (but I havent used it yet - its more fun to recreate the wheel each time :-) Peter. >> Ken Knight, Ken.Knight@f421.n109.z1.fidonet.org >> via The Black Cat's Shack's FidoNet<->Usenet Gateway >> blkcat.fidonet.org and Fidonet 1:109/401 > -- > Alex Chaffee > chaffee@reed.{UUCP,BITNET} > Reed College, Portland OR 97202 -- Disclaimer:Curtin & I have an agreement:Neither of us listen to either of us. *-------+---------+---------+---------+---------+---------+---------+-------* Internet: Lewis_P@cc.curtin.edu.au I Peter Lewis ACSnet: Lewis_P@cc.cut.oz.au I NCRPDA, Curtin University Bitnet: Lewis_P%cc.curtin.edu.au@cunyvm.bitnet I GPO Box U1987 UUCP: uunet!munnari.oz!cc.curtin.edu.au!Lewis_P I Perth, WA, 6001, AUSTRALIA "!thgir s'ti naem t'nseod yaw taht ti seod enoyreve esuaceb tsuJ"