Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Why do Managers fail when called from code resources? Message-ID: <31776@ucbvax.BERKELEY.EDU> Date: 7 Oct 89 03:42:42 GMT References: <52218@tiger.oxy.edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Distribution: usa Organization: School of Education, UC-Berkeley Lines: 33 In article <52218@tiger.oxy.edu> sonenbli@oxy.edu (Andrew D. Sonenblick) writes: > up the window or not! Dialogs don't works properly, either. > Any time I use Pascal Str255 (I'm using LSC) such as in the call > DrawString(&myString) I get nothing (the big null, nil, void) or If you read the documentation, you'd learn that THINK C 3.0 required you to use: #include main(){ RememberA0(); SetUpA4(); DebugStr((StringPtr) "\pEureka, a system call that works!"); RestoreA4(); } Wuithout the Remember, Setup, you can't get at your global variables. (Remember ahould be executed exactly once, no matter what else gets called.) THINK C v3 needed this to get at string constants. THINK C v4 doesn't need this to get at string constants, just globals. Note: the SetUpA5() macro provided in OSUtils.h is not safe for use in a multi-finder environment: it works by looking at a global variable that gets swapped in major tasks swaps, so interrupt level code routins may find the wrong value there. I handle this by cloning SetUpA4.h and changing all references to A4 to A5. > The mac is a detour in the inevitable march of mediocre computers. > drs@bnlux0.bnl.gov (David R. Stampf) --- David Phillip Oster -master of the ad hoc odd hack. Arpa: oster@dewey.soe.berkeley.edu Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu