home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20159 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.6 KB  |  42 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.cerf.net!benton.prepress.com!nuntius
  3. From: christopher m. knox <chris@benton.prepress.com>
  4. Subject: Re: Beginner's Hierarchical Menu Problem
  5. Message-ID: <1992Dec21.231606.1977@prepress.com>
  6. Sender: usenet@prepress.com (Usenet login)
  7. Nntp-Posting-Host: chris
  8. Organization: Pre-Press Technologies, Inc.
  9. X-Useragent: Nuntius v1.1b2
  10. References: <BzKItx.qs@nic.umass.edu> <BzLz4t.99u@nic.umass.edu>
  11. Date: Mon, 21 Dec 1992 23:16:06 GMT
  12. Lines: 28
  13.  
  14. In article <BzLz4t.99u@nic.umass.edu> Richard J. Resnick,
  15. rjr@titan.ucc.umass.edu writes:
  16. > (*Loads up the Desk Accesories in the Apple Menu*)
  17. >   aMenu := GetMHandle(APPLE_MENU_ID);
  18. >   AddResMenu(aMenu, 'DRVR');
  19. > (*Tries to load up the Fonts in the FONT_MENU*)
  20. >   aMenu := GetMHandle(FONT_MENU_ID);
  21. >   InsertMenu(aMenu, -1);
  22. >   AddResMenu(aMenu, 'FONT');
  23. > The error that I get when I run this under Think Pascal is "Think
  24. > Pascal unexpectedly quit", and when I build the application and run
  25. > it, I get a missing coprocessor error.
  26. >
  27. > I'v tried to change the number of the FONT resource to > 128, and
  28. >that didn't help. I tried to trace the problem, and it dies right at
  29. >AddResMenu(aMenu, 'FONT').
  30.  
  31. Hi,
  32. the call to GetMHandle() returns a handle of a menu ALREADY IN THE
  33. MENULIST. A menu will not be there until you call InsertMenu, so in
  34. all likelihood aMenu is an invalid handle and AddResMenu(aMenu...)
  35. bombs. Try: aMenu := GetMenu(FONT_MENU_ID); and check your handles
  36. against NIL before doing anything with them... it can save you a lot 
  37. of grief.
  38. Merry X-mas... Chris
  39. chris knox "Omne animal triste est post (or without) coitum"
  40.