home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14883 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  1.3 KB

  1. Path: sparky!uunet!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!kth.se!dront.nada.kth.se!d88-jwa
  2. From: d88-jwa@dront.nada.kth.se (Jon W{tte)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Set/Get Cursor
  5. Message-ID: <D88-JWA.92Sep2133855@dront.nada.kth.se>
  6. Date: 2 Sep 92 12:38:55 GMT
  7. References: <1992Sep1.202106.2865@informix.com>
  8. Sender: usenet@kth.se (Usenet)
  9. Organization: Royal Institute of Technology, Stockholm, Sweden
  10. Lines: 37
  11. In-Reply-To: sbill@informix.com's message of 1 Sep 92 20:21:06 GMT
  12. Originator: d88-jwa@dront.nada.kth.se
  13. Nntp-Posting-Host: dront.nada.kth.se
  14.  
  15. > sbill@informix.com (Bill Stackhouse) writes:
  16.  
  17.    Why does the following cause EvenBetterBusError detect a NIL pointer
  18.    problem?
  19.  
  20.       SetCursor(*GetCursor(iBeamCursor));
  21.  
  22.  
  23.  
  24. Because there's no iBeamCursor, OR you haven't locked the handle,
  25. OR the handle has been purged.
  26.  
  27. Try:
  28.  
  29.     Handle h ;
  30.     char state ;
  31.  
  32.     h = ( Handle ) GetCursor ( iBeamCursor ) ;
  33.     if ( h ) {
  34.  
  35.         if ( ! * h ) {
  36.  
  37.             LoadResource ( h ) ;
  38.         }
  39.         state = HGetState ( h ) ;
  40.         HLock ( h ) ;
  41.         SetCursor ( ( Cursor * ) * h ) ;
  42.         HSetState ( h , state ) ;
  43.     }
  44.  
  45. Only 10xx longer than your code, but it's the way you've
  46. gotta program these days. Don't whimp out.
  47.  
  48. -- 
  49. Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069
  50. White, Literate, Employed, Higher-Educated, Male, Straight and Not Poor.
  51. I must be a bad guy.
  52.