Page 1 of 1

Run time Error in handling events

Posted: Wed Jun 24, 2009 08:41
by pswin
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;
   };

};

Re: Run time Error in handling events

Posted: Wed Jun 24, 2009 22:51
by Jamarr
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