Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!mcnc!rti!rcb From: rcb@rti.UUCP (Randy Buckland) Newsgroups: comp.sys.mac.programmer Subject: Problem with menu resources. Message-ID: <2426@rti.UUCP> Date: 1 Sep 88 19:29:16 GMT Reply-To: rcb@rti.UUCP (Randy Buckland) Organization: Research Triangle Institute, RTP, NC Lines: 36 I recently had a problem in LSC 3.0 with a program trying to load menu resources. What I have is as follows, an apple menu id #1, a file menu id #2 and an edit menu id #3. THe resource file where these live has them set to preload. I also have an MBAR resource #1 that references menus 1, 2 and 3 and is set to preload. When running, I run under the debugger and get to macsbug before anything gets done. The menu and mbar resource are there and correct. I step through my program to the point where I am loading the menu resources. I make a call of the form: menu_bar = GetNewMBar(1); and then I jump back into macsbug to check things out. At this point, the MENU resource #1 is no longer there, but appears to have been freed. If I change the resource file to not preload the resources, after the above call, nothing shows up on the heap. I changed my code to not use the mbar resource, but to explicitly load the menus and build a menu bar with InsertMenu. When I do this I still get a strange behaviour. THe menu resource are not set to preload and when I load them with GetMenu, the apple menu (id #1) does not show up on the heap dump. The heap is from 0x50000 to 0xa0000 and the apple menu's handle has an address on the order of 0xc0000 while the other menus are on the order of 0x51000. With the method, the data appears to be there and everything seems to be working, I just don't understand where the apple menu structure is being stored. Any ideas? -- Randy Buckland (919)-541-7103 Research Triangle Institute rcb@rti.rti.org [128.109.139.2] {decvax,ihnp4}!mcnc!rti!rcb