After importing a wxFB project and fixing the path to the XPM tool bar graphics and compiling without errors, I get an assert failure at toolbar.cpp(795) in wxToolbar::Realize(): invalid bitmap.
The bitmap shows as expected in the preview.
The code which fails:
Code: Select all
m_toolBar->AddTool(wxID_HELP, _("tool"), wxXmlResource::Get()->LoadBitmap(wxT("help")), wxNullBitmap, wxITEM_NORMAL, _("Help"), wxT(""), NULL);
m_toolBar->Realize();
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
<object class="wxBitmap" name="help">rc\help.xpm</object>
</resource>
Code: Select all
void wxCB73DInitBitmapResources()
{
// Check for memory FS. If not present, load the handler:
{
wxMemoryFSHandler::AddFile(wxT("XRC_resource/dummy_file"), wxT("dummy one"));
wxFileSystem fsys;
wxFSFile *f = fsys.OpenFile(wxT("memory:XRC_resource/dummy_file"));
wxMemoryFSHandler::RemoveFile(wxT("XRC_resource/dummy_file"));
if (f) delete f;
else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase);
}
XRC_ADD_FILE(wxT("XRC_resource/wxBuBaseFrame_wxcr_bitmaps.cpp$rc_help.xpm"), xml_res_file_0, xml_res_size_0, wxT(""));
XRC_ADD_FILE(wxT("XRC_resource/wxBuBaseFrame_wxcr_bitmaps.cpp$F__pkg_wx_MSVC2010_wxBU-wxCR_wxBuBaseFrame_wxcr_bitmaps.xrc"), xml_res_file_1, xml_res_size_1, wxT("text/xml"));
wxXmlResource::Get()->Load(wxT("memory:XRC_resource/wxBuBaseFrame_wxcr_bitmaps.cpp$F__pkg_wx_MSVC2010_wxBU-wxCR_wxBuBaseFrame_wxcr_bitmaps.xrc"));
}
Any hints or pointers will be greatly appreciated.
TIA