home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22158 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.0 KB  |  30 lines

  1. Path: sparky!uunet!destroyer!gatech!concert!borg.cs.unc.edu!not-for-mail
  2. From: lari@cs.unc.edu (Humayun Lari)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Calling external code resources - how?
  5. Date: 25 Jan 1993 12:10:32 -0500
  6. Organization: The University of North Carolina at Chapel Hill
  7. Lines: 18
  8. Message-ID: <1k16u8INNd36@strauss.cs.unc.edu>
  9. References: <01050014.odph61@blanc.north.de> <1993Jan25.005216.12749@kth.se>
  10. NNTP-Posting-Host: strauss.cs.unc.edu
  11.  
  12. In article <1993Jan25.005216.12749@kth.se> d88-jwa@dront.nada.kth.se (Jon WΣtte) writes:
  13. [deleted]
  14. >you call 'em like:
  15. >
  16. >    Handle h = GetResource ( 'Xtns' , 128 ) ; /* Whatever */
  17. >    HLockHi ( h ) ;
  18. >    result = ( * h ) ( theCode , theInData , theOutData ) ;
  19. [rest deleted]
  20.  
  21. It's a good idea to StripAddress the pointer first, say:
  22.         funcPtr = StripAddress(*h);
  23.         result = funcPtr(theCode, theInData, theOutData);
  24.  
  25. This is really only necessary if the code resource will call SwapMMUMode,
  26. but it's better to be safe...
  27.  
  28. Humayun Lari
  29. (lari@cs.unc.edu)
  30.