Jump to content
  • Advertisement
Sign in to follow this  
tplague

Unhandled exception. Access violation reading location

This topic is 2637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Breaks on this:

Pushed->subscribeEvent(PushButton::EventMouseClick, Event::Subscriber(&GameOptions::Pushed, this));

Hmm...I wonder why :\

Share this post


Link to post
Share on other sites
Advertisement
That is the definition of the GameOptions::Pushed method (event handler?).

I think pulpfist was asking for the Pushed in front of the "->" operator.

Share this post


Link to post
Share on other sites

That is the definition of the GameOptions::Pushed method (event handler?).

I think pulpfist was asking for the Pushed in front of the "->" operator.


Ah sorry, a little burnt out from looking at the screen for hours.

Pushed = GameOptionsWindow->getChild("GameOptions/Button/Continue");

And yes, the layout exists and is setup correctly :\

Share this post


Link to post
Share on other sites

That is the definition of the GameOptions::Pushed method (event handler?).

I think pulpfist was asking for the Pushed in front of the "->" operator.


Thats right.


The error indicates accessing a NULL or a stray pointer.

Share this post


Link to post
Share on other sites

[quote name='brx' timestamp='1317122002' post='4866391']
That is the definition of the GameOptions::Pushed method (event handler?).

I think pulpfist was asking for the Pushed in front of the "->" operator.


Ah sorry, a little burnt out from looking at the screen for hours.

Pushed = GameOptionsWindow->getChild("GameOptions/Button/Continue");

And yes, the layout exists and is setup correctly :\
[/quote]

Have you checked that Pushed is valid using the debugger?

Share this post


Link to post
Share on other sites
Hmm..
All I remember of CEGui was that it was a pain to make it work.

It looks like others have had problems with subscribeEvent before:

http://www.cegui.org.uk/phpBB2/viewtopic.php?f=2&t=1670
http://www.crystalspace3d.org/forum/index.php?topic=1596.0
http://www.codeguru.com/forum/showthread.php?t=391820

That last link suggests that the code in the Pushed handler is making problems. You could try to out comment this line
CScene::GS().PostEvent(SC_EVENT_OPTIONS_STOP);
and see if that changes anything.

If you are using Visual C++ you can set a breakpoint at some line by left clicking at the left side of the line. You should see a red circle.
Then, when you run the project using the debug menu option, it should halt at the line with the breakpoint, and you should be able to hover the mouse over the variables and pointers to inspect their values and addresses. Maybe that could give you a hint of what is wrong.

Other than that, its hard to say without having the debugger in front to me.

Maybe someone with more experience with CEGui can help...

Share this post


Link to post
Share on other sites
I found something in this blog that might be relevant:



[color=#444444]When working on the GUI (CEGUI) that really came back and bit us in the ass. All was well untill I tried to add event handling with the subscribeEvent method.Bang! Access Violation! And since I was not linking to the debug version of the CEGUI library, I was left in the dark figuring out what just happened. After some time (way to much time) I eventually had the epiphany to google the segfault.

The reason for the access violation was that I was running my application in debug mode, and were linking to the CEGUI release mode libraries (asexplained in this CEGUI forum post). So now I had the motivation to get Visual Studio to link to the correct libraries based on the chosen configuration.


[/quote]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!