Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!mintaka!ogicse!hsdndev!husc3.harvard.edu!husc9.harvard.edu!wysocki From: wysocki@husc9.harvard.edu (Christopher Wysocki) Newsgroups: comp.sys.mac.programmer Subject: Re: How do I call on assembly from C? Keywords: QuickDraw BitMapToRegion inline function C Message-ID: <1991Jun4.220903.1314@husc3.harvard.edu> Date: 5 Jun 91 02:09:02 GMT Article-I.D.: husc3.1991Jun4.220903.1314 References: <1991Jun4.190036.15349@cs.yale.edu> Organization: Harvard University, Cambridge, MA Lines: 31 Nntp-Posting-Host: husc9.harvard.edu In article <1991Jun4.190036.15349@cs.yale.edu> pittenger-laurence@cs.yale.edu (Laurence Arthur Pittenger) writes: >A few days back someone posted about converting Bitmaps to regions. >There's a call at assembly location 0xA8D7 which takes (RgnHandle >theRgn, BitMap* theMap) as parameters to do this. > >Well, I'm running Think C and it doesn't have this call. But I >figured I could just call on the command directly, since I know its >address. But I can't figure out how to do it. > >I tried CallPascal (theRgn, theMap, 0xA8D7) but was criticized by the >debugger for an "odd address". I also tried making a function type of >the appropriate nature and assigning BitmapToRgn = (functype) 0xA8D7, >but it didn't like BitmapToRgn (theRgn, theMap) either. > >So how do I do it? Try declaring the function BitMapToRegion as: pascal OSErr BitMapToRegion(RgnHandle region, BitMap *bMap) = 0xA8D7; and then just say: BitMapToRegion(theRgn, theMap); Hope this helps. Chris Wysocki wysocki@husc9.harvard.edu