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