Run time Error in handling events

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

pswin
Just popping in
Just popping in
Posts: 5
Joined: Wed Jun 24, 2009 08:35

Run time Error in handling events

Postby pswin » Wed Jun 24, 2009 08:41

hi i have run time error in my application

error code:

Code: Select all

Unhandled exception at 0x010051b8 in CEGUI_SDL.exe: 0xC0000005: Access violation reading location 0x00000039.


handling event code:
class Event
{
public:

Code: Select all

   Event()
   {

      CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();

      wmgr.getWindow("btn1")->
      subscribeEvent(CEGUI::PushButton::EventClicked,
      CEGUI::Event::Subscriber(&Event::Btn_Clicked , this));
   }

   bool Event::Btn_Clicked(const CEGUI::EventArgs& e)
   {
      std::cout << "btn1 clicked" << std::endl;
      return true;
   };

};

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Run time Error in handling events

Postby Jamarr » Wed Jun 24, 2009 22:51

Steps:
1) Never make a post about "some random error" and/or post an "unhandled exception" error message that tells us nothing
2) Search the website or forums before posting your question: it may have already been answered or tips given to help you with your problem
3) Always place a try/catch block around CEGUI calls to catch and notify you of exceptions
4) Always check your CEGUI.log file for errors
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests