CrazyEddie wrote:I don't know. Have you moved the executable from it's original built location? If so you also need to ensure the 'data' directory is next to the .exe file. It might also be a working directory issue if you're running from within the debugger.
CE.
hi CE
thanks your help
i do nont move the executable,but i copy the cegui's dll to ceimageseteditor's bin folder by myself not use build event->post-build event,i don't think that is problem,
is it relationship between cegui's dll and data directory??
then i check ceimageseteditor's code step by step, i found the bug location,but i don't know how to fix it
here is location of bug
Code: Select all
...
bool CEImagesetEditor::OnInit( void )
{
// Log some platform info
wxLogDebug( wxT( "Default Gui font: %s, %d" ), wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ).GetFaceName().c_str(), wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ).GetPointSize() );
// Create a document manager
m_docManager = new wxDocManager;
wxImage::AddHandler( new wxPNGHandler );
// Create a template relating drawing documents to their views
new wxDocTemplate( m_docManager, wxT( "imageset files" ), wxT( "*.xml;*.imageset" ), wxT( "" ), wxT( "xml" ), wxT( "Editor Document" ), wxT( "Editor View" ),
CLASSINFO( EditorDocument ), CLASSINFO( EditorView ) );
// If we've only got one window, we only get to edit
// one document at a time.
m_docManager->SetMaxDocsOpen( 1 );
try
{
// Create Single-Document main frame, just look default position and dimensions
GlobalFrame = new EditorFrame( m_docManager, 0, wxID_ANY, wxT( "CEImagesetEditor" ), wxDefaultPosition, wxSize( 800, 600 ), wxDEFAULT_FRAME_STYLE );
// Prepare for the rendering canvas
// We need to show the frame otherwise the CEGUI opengl renderer won't
// be able to initialze, because the opengl viewport is not valid then.*/
GlobalFrame->Centre( wxBOTH );
GlobalFrame->Show( true );
// This needs to be in the try-block!
GlobalFrame->AttachCanvas( 0 ); //-------------- from here into catch ( CEGUI::Exception & guiException ),so i go into this function :
SetTopWindow( GlobalFrame );
return true;
}
catch ( CEGUI::Exception & guiException )
{
// If something goes wrong, show user
wxLogError ( wxT( "ImagesetEditor::OnInit - Error: %s" ), CEGUIHelper::ToWXString( guiException.getMessage() ).c_str() );
return false;
}
////////////////////////////////////////////////////////////////
here is that function:
...
EditorGLCanvas* EditorFrame::AttachCanvas( EditorView* view )
{
// Create the GLCanvas. This apprauch provides MDI support maybe in the future
EditorGLCanvas* canvas = new EditorGLCanvas( view, m_splitter, wxDefaultPosition, wxDefaultSize ); //---------------- ths is bug position! it goto up(catch ( CEGUI::Exception & guiException ))
// add the canvas to the frame
// Tell it about the initial size
m_splitter->SplitVertically( m_propsPanel, canvas, 250 );
canvas->ClearBackground();
canvas->Disable();
canvas->setBackgroundColour( m_backgroundColour );
// Copy into member
m_glcanvasImageset = canvas;
return canvas;
}
...
and thanks again