Page 1 of 1

wxC7C26InitBitmapResources();

Posted: Sat Dec 28, 2013 12:48 am
by coder99
In building up another GUI using wxCR 1.3 I end up with this code fragment in my base frame cpp:

Code: Select all

// Declare the bitmap loading function
extern void wxC7C26InitBitmapResources();  <<<<<<<<<<<<<<<<<<<<

static bool bBitmapLoaded = false;


MyFrameBase::MyFrameBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxFrame(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC7C26InitBitmapResources();
        bBitmapLoaded = true;
    }
......
}
But I cannot find wxC7C26InitBitmapResources() anywhere.

The GUI does use XMP icons in the tool bar - possibly that is the problem??

The icons display well enough in wxCR

Re: wxC7C26InitBitmapResources();

Posted: Sat Dec 28, 2013 12:53 am
by eranif
wxCrafter generates another file with the prefix *_bitmap.cpp file, make sure you add it also to your workspace
It is explained here:

http://codelite.org/LiteEditor/WxCrafterHelloWorld

Eran

Re: wxC7C26InitBitmapResources();

Posted: Sat Dec 28, 2013 1:24 am
by coder99
Thank you, Eran
I had missed that one and, of course, because it was not part of the project, the search in the project did not find it., but ...
when I add the file to my project, I get:
3>wxMetaf_wxmeta-wxcr_bitmaps.cpp(345): error C2466: cannot allocate an array of constant size 0

this is apparently due to my adding blank tool bar items, in place of spacers.
These blanks seem to default to include a file %USER%\AppData\Local\Temp\placeholder16.png
which does exist.
Removing the file path removed the array with 0 size and lets the compile complete.