Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!decwrl!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Finding the size of the screen under Multifinder/Color QD Message-ID: <9490@hoptoad.uucp> Date: 5 Jan 90 05:17:58 GMT References: <10139@saturn.ucsc.edu> <9429@hoptoad.uucp> <1102@urbana.mcd.mot.com> <10164@saturn.ucsc.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 41 In article <1102@urbana.mcd.mot.com> willcox@urbana.mcd.mot.com (David A Willcox) writes: >>This sounds a bit like what happened when I tried to use screenBits >>from within an XCMD. The problem, of course, was that I hadn't called >>InitGraf() (I hope that's the right name) from within my XCMD, and I >>was seeing a local copy of screenBits that had not been initialized. In article <10164@saturn.ucsc.edu> sirkm@ssyx.ucsc.edu (Greg Anderson) writes: >I know it's illegal to call InitGraf() from within XCMD's, but can I >call it from within a DA? It seems like I would have the same problems >you experienced. It sounds like your problem is with THINK C. If you'll look on page 78 of the THINK C 3.0 Manual, you'll find that this issue is explicitly addressed. "If you access these globals from a driver, you'll find that they aren't the real QuickDraw globals but simply the driver's own globals that QuickDraw knows ntohing about. You can access the real QuickDraw globals from a driver by observing that 0(A5) holds the address of the last of the QuickDraw globals, thePort. The remaining QuickDraw globals are at descending addresses from thePort; refer to Inside Macintosh I, Chapter 6, 'QuickDraw', for more information." This is what I told you in my last message, but perhaps you'll take it more seriously from the compiler manual. You haven't been looking at screenBits.bounds at all.... >If I cannot call InitGraf() from within my DA, then how can I find the >size of the screen? screenbits.bounds can be used under UniFinder, and >I can look at the main screen's gDevice on a system with color quickdraw, >but that still leaves me stuck in Multifinder systems that don't have >color quickdraw. Use inline assembly language in THINK C to access the QD globals from non-applications. Use screenBits.bounds to find the size of the screen. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com FROM THE FOOL FILE: "I wouldn't work for Dukakis if my life depended on it. I've worked for Greeks and I know just how filthy and stinking they can be." -- Caller, KGO-AM, 8 Nov 88