RE: [Plib-users] pui help
Brought to you by:
sjbaker
From: Clay, B. <bc...@ba...> - 2004-04-07 19:01:57
|
Brian: I had to go back to my deleted mail to check this. In one of your later mails you said that backButton is global but you are redefining it in: void createTeamButtons() { puOneShot *backButton =3D new puOneShot (20.0, 20.0, 170.0, 50.0); ... You may want to double check that Bruce -----Original Message----- From: pli...@li... [mailto:pli...@li...] On Behalf Of Brian Smith Sent: Tuesday, April 06, 2004 10:20 PM To: pli...@li... Subject: Re: [Plib-users] pui help >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()=20 >>the program crashes and I get an unhandled exception: access violation. =20 >>Any suggestions?? thanks in advance. > >Well, I've used hide() quite a bit with no problems - we're going to=20 >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=20 >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=20 >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=20 source. I have two display functions, the first one has no pui objects at=20 all but when i switch to the second display function there are some buttons=20 on it, one of the buttons I have is a back button which returns to the first=20 display function. so when the second display function is eventually called I call the function=20 createTeamButtons() which is this: void createTeamButtons() { puOneShot *backButton =3D 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=20 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=20 hideTeamButtons() (I was gonna try just deleting everything=20 everytime the program returns to the first display function but=20 figured hide would be much easier) there are more buttons for the second display function but this is the most=20 relevent one, if I try hide one or hide them all doesn't matter so only put=20 the one in. Thats all i got for ya, if theres anything else ya want let me=20 know. -Brian _________________________________________________________________ MSN Toolbar provides one-click access to Hotmail from any Web page - FREE=20 download! http://toolbar.msn.com/go/onm00200413ave/direct/01/ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck _______________________________________________ plib-users mailing list pli...@li... https://lists.sourceforge.net/lists/listinfo/plib-users |