I've done a lot of Googling and seen a few people having this same problem, but I've been unable to find a solution that works.
The problem is that I can't use a PNG file from my resource.rc file. I followed the instructions here:
https://wiki.wxwidgets.org/Embedding_PN ... ource_file
but it just won't work.
Code: Select all
wxImage::AddHandler(new wxPNGHandler);
wxBitmap exit(wxT("exit.png"), wxBITMAP_TYPE_PNG); // this works; it loads the external PNG file and I can then use it on my toolbar
wxBITMAP_PNG(IDB_PNG2); // this doesn't work (I know the bitmap doesn't get assigned anywhere, but it should still work, right?)
even though IDB_PNG2 is most definitely in my resource.rc and resource.h files:
Code: Select all
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Resource.rc
//
#define IDB_PNG2 105
Code: Select all
/////////////////////////////////////////////////////////////////////////////
//
// PNG
//
IDB_PNG2 RCDATA "hand.png"
The only thing I've found so far which does work is:
Code: Select all
wxBITMAP_PNG(#105)
What can I do to figure out the problem?
PS My program, such as it is, is based on the HelloWorld example