Re: [Plib-users] pui help
Brought to you by:
sjbaker
From: Brian S. <sch...@ho...> - 2004-04-07 02:20:12
|
>Brian Smith wrote: >>Running VC++6.0 with windows XP, plib 1.8.2, I was wondering if anyone >>could help me out, I need to hide puObjects but whenever I use .hide() >>the program crashes and I get an unhandled exception: access violation. >>Any suggestions?? thanks in advance. > >Well, I've used hide() quite a bit with no problems - we're going to need >a LOT more information if this is truly a PLIB bug. > >It crashes inside hide() ? > >If so, it *MUST* be that the puObject you are calling it on is an >invalid pointer...all hide() does is access an internal member and call >puPostRefresh - and all THAT does is set a global. > >However, if calling hide() causes it to die sometime later then >we could be looking at something complicated. > >Could you get us a stack back-trace from the crash? Or maybe >show us some source code? > I'll try and explain what the program is doind and show ya the relevant source. I have two display functions, the first one has no pui objects at all but when i switch to the second display function there are some buttons on it, one of the buttons I have is a back button which returns to the first display function. so when the second display function is eventually called I call the function createTeamButtons() which is this: void createTeamButtons() { puOneShot *backButton = new puOneShot (20.0, 20.0, 170.0, 50.0); backButton->setLegend("Back"); backButton->setCallback(backButtonCallback); } the callback function for this button (backButtonCallback) is this: void backButtonCallback(puObject *) { glutKeyboardFunc(NULL); glutSpecialFunc(NULL); glutIdleFunc(Main_Display); glutDisplayFunc(Main_Display); glutPassiveMotionFunc(Main_MouseMove); glutMouseFunc(Main_MouseChoose); hideTeamButtons(); } and hide TeamButtons() is this: void hideTeamButtons() { backButton->hide(); } so in the program when I click the back button the program crashes and an error dialog pops up saying: Unhandled exception in program.exe: 0xC0000005: Access Violation. I say it crashes on hide because: 1)when I debug it is calling the hide function in pu.h while crash 2)if hide() isn't in hideTeamButtons() (I was gonna try just deleting everything everytime the program returns to the first display function but figured hide would be much easier) there are more buttons for the second display function but this is the most relevent one, if I try hide one or hide them all doesn't matter so only put the one in. Thats all i got for ya, if theres anything else ya want let me know. -Brian _________________________________________________________________ MSN Toolbar provides one-click access to Hotmail from any Web page FREE download! http://toolbar.msn.com/go/onm00200413ave/direct/01/ |