Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!decwrl!world!siegel From: siegel@world.std.com (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Think Pascal 3.02 Problems... Message-ID: <1991May15.023918.9516@world.std.com> Date: 15 May 91 02:39:18 GMT References: <1991May14.180045.483@cs.utk.edu> Distribution: usa Organization: Symantec Language Products Group Lines: 42 In article <1991May14.180045.483@cs.utk.edu> danny@utkux1.utk.edu ("Danny W. McCampbell") writes: >I am write a chunk of code that simple draws the Menu Bar for my program, >but when I run it from within Think Pascal 3.02 I get a bus error at the >designated line: > > procedure Menus; > begin {Menus} > ClearMenuBar; {Clear old Menu Bar} > vBPMBAR := GetNewMBar(BPMBAR); {Get the MBAR for BP} > SetMenuBar(vBPMBAR); {Set BP's MBAR as current Menu Bar} > DisposHandle(vBPMBAR); {Release handle from Memory} > vAppleMenu := GetMHandle(AppleMenu); {Get the handle for the Apple Menu} > AddResMenu(vAppleMenu, 'DRVR'); {Add the Desk Accessories} > DrawMenuBar; {Draw the Menu Bar now}-----------Bus Error right >here! > end; {Menus} > Don't DisposeHandle the menu bar you're about to draw with, and it should work correctly. (This is neither a Pascal 3.0.2 nor a System 7.0b4 problem, as far as I can tell.) >I have an SE/30 with 8 megs of Ram running 7.0b4. > >Please help me out. Thanks > >Danny McCampbell >Computer Operator/Systems Analyst >University of Tennessee (Knoxville) >2339 Dunford Hall >Knoxville, TN 37916 >Phone: (615) 974-0138 R. -- ----------------------------------------------------------------------- Rich Siegel Internet: siegel@world.std.com Software Engineer Applelink: SIEGEL Symantec Languages Group