subscribeEvent crash APP please help me

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

Percy Camilo
Just popping in
Just popping in
Posts: 9
Joined: Fri Jul 28, 2006 22:00
Location: Perú

subscribeEvent crash APP please help me

Postby Percy Camilo » Sun Aug 20, 2006 00:36

Hello everybody, here again with a little problem, when i use this sentence:

Code: Select all

btnExit->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&pctaCEGUI::btnExitEvent, this));

My app start but after 1 second crash.
I'm porting my app to windows (the code works on etch).
This are some feactures that could help to understand my problem:
Platform = winXP
IDE = VC++ 6.0 Profesonal Ed...
CEGUI = Stable release with STLport
STLport = version: 4.6.2
Renderer = Opengl on SDL
SDL = stable 1.2.11
Link->Input = devil.lib ilu.lib ilut.lib glu32.lib opengl32.lib sdlmain.lib sdl.lib ceguibase.lib OpenGLGUIRenderer.lib stlport_vc6.lib

I have all the dependences and the first example founded in the CEGUIwiki
works but i dont know why this line crahs my app, if i coment that line then the app works but my button don't have any event.

the code is:

Code: Select all

void someCEGUIClass::initCEGUI()
{
...
  mRenderer = new CEGUI::OpenGLRenderer(0);
  mSystem = new CEGUI::System(mRenderer);
       
  CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
  CEGUI::SchemeManager &shmgr = CEGUI::SchemeManager::getSingleton(); 
  shmgr.loadScheme("../datafiles/schemes/TaharezLookSkin.scheme");

  CEGUI::Window* myRoot = wmgr.createWindow("DefaultWindow", "root");
    mSystem->setGUISheet(myRoot);
    mSystem->setDefaultMouseCursor("TaharezLook", "MouseArrow");

  //  CEGUI::FrameWindow* fWnd = dynamic_cast<CEGUI::FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "frame1"));
  CEGUI::FrameWindow* fWnd = static_cast<CEGUI::FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "frame1"));
    CEGUI::FontManager::getSingleton().createFont("../datafiles/fonts/Iconified-12.font");
    fWnd->setPosition( CEGUI::Point( 0.1f, 0.1f ) );
    fWnd->setSize(CEGUI::Size(0.5f, 0.5f));
    fWnd->setText("Some caption");
    fWnd->setAlpha(0.5);
  myRoot->addChildWindow(fWnd);


  // CEGUI::PushButton *btnExit = dynamic_cast<CEGUI::PushButton*>(wmgr.createWindow("TaharezLook/Button", "exitButton"));
  CEGUI::PushButton *btnExit = static_cast<CEGUI::PushButton*>(wmgr.createWindow("TaharezLook/Button", "exitButton"));
    fWnd->addChildWindow(btnExit);
    btnExit->setPosition(CEGUI::Point(0.5, 0.5));
    btnExit->setSize(CEGUI::Size(0.25, 0.1));
    btnExit->setText("Exit");
    btnExit->setInheritsAlpha(false);
[b]/* this is  */[/b]
    btnExit->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&pctaCEGUI::btnExitEvent, this));
    btnExit->setAlwaysOnTop(true);

... more widgets ...
}


the btnExitEvent function is :

Code: Select all

bool pctaCEGUI::btnExitEvent(const CEGUI::EventArgs& e)
{
  SDL_Quit();
  exit(0);
  return true;
}


I don't know what happends. Please any help or suggestion will be execelent :wink:

pd: the CEGUI log don't tellme nothing , i supouse that this kind of problem don't don't have relation with the XML files.

User avatar
Levia
Quite a regular
Quite a regular
Posts: 83
Joined: Mon May 22, 2006 18:25
Location: Bergen op zoom, The Netherlands
Contact:

Postby Levia » Sun Aug 20, 2006 07:17

You could check out the .exe with www.dependencywalker.com and see if it misses the function subscribeEvent in CEGUIBase(_d).dll. I had this problem too and I had to recompile some stuff in order to get it work.
Image
Image

Percy Camilo
Just popping in
Just popping in
Posts: 9
Joined: Fri Jul 28, 2006 22:00
Location: Perú

Postby Percy Camilo » Sat Aug 26, 2006 16:50

Solved, thx a lot :D , i was using the VC++6 SDK, but now i built CEGUI from the source.

But i have a simple question.
Why are the DLLs built in debug mode?, and.
How can i build CEGUI in release mode?
I don't want to debug my apps so, i don't need this DLLs.

Please, can anyone help me? give me some suggestions, i'm very new in VC++6.

thx again bytes

User avatar
Levia
Quite a regular
Quite a regular
Posts: 83
Joined: Mon May 22, 2006 18:25
Location: Bergen op zoom, The Netherlands
Contact:

Postby Levia » Sun Aug 27, 2006 08:13

At the top of the app, there is a combobox - saying debug in your case. click it, and select release.
Image

Image

Percy Camilo
Just popping in
Just popping in
Posts: 9
Joined: Fri Jul 28, 2006 22:00
Location: Perú

Postby Percy Camilo » Sun Aug 27, 2006 22:53

Hello man, you're right, my problem is solved, thx a lot,
i'am hapy now :D
Bytes


Return to “Help”

Who is online

Users browsing this forum: No registered users and 17 guests