Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!apple!enwall From: enwall@Apple.COM (Tim Enwall) Newsgroups: comp.sys.mac.programmer Subject: Re: serial question Message-ID: <35526@apple.Apple.COM> Date: 10 Oct 89 15:56:48 GMT References: <5727@tank.uchicago.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 28 In article <5727@tank.uchicago.edu> rfl@oddjob.UChicago.EDU (Bob Loewenstein) writes: > >I have a program where I use the serial driver at 19200 baud. I >set the size of the internal buffer to a large block so that I don't >miss any transmissions while I'm not reading the port (64 bytes, the >default, is too small). My problem is this: If someone using the program >decides to open up some terminal emulator desk accessory, or switches >via multifinder to another program that wants the port, when they >switch back to my application, always my buffer is no longer used and >the default is back; sometimes it screws things up altogether and >causes a bomb. > You can use suspend/resume events to get notified when your your application is being put into the background/foreground and do whatever is necessary to save the state of your program. The "Programmer's Guide to MultiFinder" available from APDA explains suspend resume events, as do five of the current Tech Notes. Hope this helps. -- Tim Enwall Macintosh Developer Technical Support Apple Computer, Inc. "Opinion's but a fool, that makes us scan The outward habit by the inward man" -- Pericles, Act II. Sc.2