Path: utzoo!attcan!uunet!husc6!uwvax!oddjob!gargoyle!att!ihnp4!poseidon!ech From: ech@poseidon.UUCP (Edward C Horvath) Newsgroups: comp.sys.mac.programmer Subject: Parameterizable INITs (was:Dialogs in INITS (LSC3)) Message-ID: <491@poseidon.UUCP> Date: 7 Sep 88 14:59:46 GMT References: <6860023@vx2.NYU.EDU> Organization: AT&T Information Systems, Lincroft, NJ Lines: 40 From article <6860023@vx2.NYU.EDU>, by spector@vx2.NYU.EDU (David HM Spector): > As I recall from looking at an LSC version of ShowINIT (a klone of the > MPW object written by Apple's Paul Mercer) which shows the icons of INITs > at System startup time, you need to have your own QD globals set up, because > at INIT31 time the universe is not fully formed yet, and as such QuickDraw > and things that rely upon it are most likely bound to do bad things. I don't remember which TechNote addresses this issue, but there is one (somewhere in the 70-100 range, I think, check the TN index). I do recall that QuickDraw HAS been set up, but not the Window Manager. The "Welcome to Macintosh" pseudo-window is actually drawn by the System Error package -- see IM-2. When an INIT blows away that fake window, it just called InitWindows. INITs essentially have a partially-initialized application going for them: there IS an application heap, and so things like the Resource Manager and Memory Manager are available. But if you really need an INIT that is "parameterizable," consider doing a cdev instead, with default behavior set to be innocuous. That way, the user can install your goody by just dropping it into the System Folder, configure it now or later with the Control Panel, then reboot to get the full effect. On that same subject, there was discussion recently of installing a DRVR at INIT time that the cdev could later communicate with. That gives me a problem: there is VERY limited space in the unit table -- i.e. there aren't that many DRVR slots -- and they ALL appear to be "pre-allocated" by Apple. So which ones do you use? What do you do if your favorite slot is occupied? I'm considering a different approach: let the INIT add a task to the VBL queue, with a long timeout, and leave the cdev's name in a prominent place in the header of the VBL task. This requires the cdev to scan the VBL queue intead of just doing an _Open, but has the same desired effect. Granted, VBL tasks don't have the same "stature" as a DRVR -- the MacOS doesn't maintain a DCE or feed you accRun (or other useful) events -- but for many purposes those may not be required. Is there some reason this won't work? Other comments? =Ned Horvath=